summaryrefslogtreecommitdiffstats
path: root/crypto/kerberosIV/lib
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/kerberosIV/lib')
-rw-r--r--crypto/kerberosIV/lib/kadm/kadm_err.et2
-rw-r--r--crypto/kerberosIV/lib/kafs/kafs.h10
-rw-r--r--crypto/kerberosIV/lib/kdb/base64.c150
-rw-r--r--crypto/kerberosIV/lib/kdb/base64.h47
-rw-r--r--crypto/kerberosIV/lib/kdb/kdc.h5
-rw-r--r--crypto/kerberosIV/lib/kdb/krb_db.h3
-rw-r--r--crypto/kerberosIV/lib/krb/et_list.c74
-rw-r--r--crypto/kerberosIV/lib/krb/gettimeofday.c56
-rw-r--r--crypto/kerberosIV/lib/krb/k_concat.c116
-rw-r--r--crypto/kerberosIV/lib/krb/k_flock.c95
-rw-r--r--crypto/kerberosIV/lib/krb/k_gethostname.c58
-rw-r--r--crypto/kerberosIV/lib/krb/krb.h21
-rw-r--r--crypto/kerberosIV/lib/krb/lsb_addr_comp.h26
-rw-r--r--crypto/kerberosIV/lib/krb/netread.c55
-rw-r--r--crypto/kerberosIV/lib/krb/netwrite.c52
-rw-r--r--crypto/kerberosIV/lib/krb/resolve.c288
-rw-r--r--crypto/kerberosIV/lib/krb/resolve.h110
-rw-r--r--crypto/kerberosIV/lib/krb/swab.c56
-rw-r--r--crypto/kerberosIV/lib/krb/util.c64
-rw-r--r--crypto/kerberosIV/lib/roken/roken.h338
20 files changed, 25 insertions, 1601 deletions
diff --git a/crypto/kerberosIV/lib/kadm/kadm_err.et b/crypto/kerberosIV/lib/kadm/kadm_err.et
index 7a247c5..097e87c 100644
--- a/crypto/kerberosIV/lib/kadm/kadm_err.et
+++ b/crypto/kerberosIV/lib/kadm/kadm_err.et
@@ -7,6 +7,8 @@
#
# Kerberos administration server error table
#
+# $FreeBSD$
+#
et kadm
# KADM_SUCCESS, as all success codes should be, is zero
diff --git a/crypto/kerberosIV/lib/kafs/kafs.h b/crypto/kerberosIV/lib/kafs/kafs.h
index 0fb969e..650d6ff 100644
--- a/crypto/kerberosIV/lib/kafs/kafs.h
+++ b/crypto/kerberosIV/lib/kafs/kafs.h
@@ -14,7 +14,12 @@
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
- * 3. Neither the name of the Institute nor the names of its contributors
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the Kungliga Tekniska
+ * Högskolan and its contributors.
+ *
+ * 4. Neither the name of the Institute nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
@@ -31,7 +36,8 @@
* SUCH DAMAGE.
*/
-/* $Id: kafs.h,v 1.32 1999/12/02 16:58:40 joda Exp $ */
+/* $Id: kafs.h,v 1.31 1999/07/07 12:30:40 assar Exp $ */
+/* $FreeBSD$ */
#ifndef __KAFS_H
#define __KAFS_H
diff --git a/crypto/kerberosIV/lib/kdb/base64.c b/crypto/kerberosIV/lib/kdb/base64.c
deleted file mode 100644
index d7e89c4..0000000
--- a/crypto/kerberosIV/lib/kdb/base64.c
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the Kungliga Tekniska
- * Högskolan and its contributors.
- *
- * 4. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-RCSID("$Id: base64.c,v 1.7 1997/04/01 08:18:16 joda Exp $");
-#endif
-
-#include <stdlib.h>
-#include <ctype.h>
-#include <string.h>
-#include "base64.h"
-
-static char base64[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
-
-static int POS(char c)
-{
- if(c == '=') return 64;
- if(isupper(c))
- return c - 'A';
- if(islower(c))
- return c - 'a' + 26;
- if(isdigit(c))
- return c - '0' + 52;
- if(c == '+')
- return 62;
- if(c == '/')
- return 63;
- return -1;
-}
-
-char *base64_encode(const void *buf, int size)
-{
- char *str = (char*)malloc((size+3)*4/3+1);
- char *p=str;
- unsigned char *q = (unsigned char*)buf;
- int i;
- int c;
- i=0;
- while(i<size){
- c=q[i++];
- c*=256;
- if(i<size)
- c+=q[i];
- i++;
- c*=256;
- if(i<size)
- c+=q[i];
- i++;
- p[0]=base64[(c&0x00fc0000) >> 18];
- p[1]=base64[(c&0x0003f000) >> 12];
- p[2]=base64[(c&0x00000fc0) >> 6];
- p[3]=base64[(c&0x0000003f) >> 0];
- if(i>size)
- p[3]='=';
- if(i>size+1)
- p[2]='=';
- p+=4;
- }
- *p=0;
- return str;
-}
-
-/* convert string in s to binary data. s should be a multiple of 4
- * bytes long. data should be at least len(s) * 3 / 4 bytes long.
- * returns
- */
-int base64_decode(char *s, void *data)
-{
- char *p;
- unsigned char *q;
- int n[4];
-
- if(strlen(s) % 4)
- return -1;
- q=(unsigned char*)data;
- for(p=s; *p; p+=4){
- n[0] = POS(p[0]);
- n[1] = POS(p[1]);
- n[2] = POS(p[2]);
- n[3] = POS(p[3]);
- if((n[0] | n[1] | n[2] | n[3]) < 0)
- return -1;
-
- if(n[0] == 64 || n[1] == 64)
- return -1;
- if(n[2] == 64 && n[3] < 64)
- return -1;
- q[0] = (n[0] << 2) + (n[1] >> 4);
- if(n[2] < 64){
- q[1] = ((n[1] & 15) << 4) + (n[2] >> 2);
- }
- if(n[3] < 64){
- q[2] = ((n[2] & 3) << 6) + n[3];
- }
- q+=3;
- }
- q -= (n[2] == 64) + (n[3] == 64);
- return q - (unsigned char*)data;
-}
-
-#ifdef TEST
-int main(int argc, char **argv)
-{
- char str[128];
- char buf[128];
- char *p;
- printf("base64_encode(\"%s\") = \"%s\"\n", argv[1],
- p=base64_encode(argv[1], strlen(argv[1])));
- printf("base64_decode(\"%s\") = %d", p, base64_decode(p, buf));
- printf(" (\"%s\")\n", buf);
- printf("base64_decode(\"%s\") = %d", argv[1], base64_decode(argv[1], buf));
- printf(" (\"%s\")\n", buf);
-}
-#endif
diff --git a/crypto/kerberosIV/lib/kdb/base64.h b/crypto/kerberosIV/lib/kdb/base64.h
deleted file mode 100644
index edfb344..0000000
--- a/crypto/kerberosIV/lib/kdb/base64.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the Kungliga Tekniska
- * Högskolan and its contributors.
- *
- * 4. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* $Id: base64.h,v 1.5 1997/04/01 08:18:16 joda Exp $ */
-
-#ifndef _BASE64_H_
-#define _BASE64_H_
-
-char *base64_encode(const void *buf, int size);
-int base64_decode(char *s, void *data);
-
-#endif
diff --git a/crypto/kerberosIV/lib/kdb/kdc.h b/crypto/kerberosIV/lib/kdb/kdc.h
index f404d11..968775d 100644
--- a/crypto/kerberosIV/lib/kdb/kdc.h
+++ b/crypto/kerberosIV/lib/kdb/kdc.h
@@ -1,5 +1,6 @@
/*
* $Id: kdc.h,v 1.8 1997/04/01 03:59:05 assar Exp $
+ * $FreeBSD$
*
* Copyright 1987, 1988 by the Massachusetts Institute of Technology.
*
@@ -14,8 +15,8 @@
/* Don't depend on this! */
#ifndef MKEYFILE
-#if 0
-#define MKEYFILE "/var/kerberos/master-key"
+#if 1
+#define MKEYFILE "/etc/kerberosIV/master-key"
#else
#define MKEYFILE "/.k"
#endif
diff --git a/crypto/kerberosIV/lib/kdb/krb_db.h b/crypto/kerberosIV/lib/kdb/krb_db.h
index 1a08b83..d0fc260 100644
--- a/crypto/kerberosIV/lib/kdb/krb_db.h
+++ b/crypto/kerberosIV/lib/kdb/krb_db.h
@@ -1,5 +1,6 @@
/*
* $Id: krb_db.h,v 1.15 1996/12/17 20:34:32 assar Exp $
+ * $FreeBSD$
*
* Copyright 1987, 1988 by the Massachusetts Institute of Technology.
*
@@ -24,7 +25,7 @@
#define KERB_DEFAULT_NAME "default"
#define KERB_DEFAULT_INST ""
#ifndef DB_DIR
-#define DB_DIR "/var/kerberos"
+#define DB_DIR "/var/db/kerberos"
#endif
#ifndef DBM_FILE
#define DBM_FILE DB_DIR "/principal"
diff --git a/crypto/kerberosIV/lib/krb/et_list.c b/crypto/kerberosIV/lib/krb/et_list.c
deleted file mode 100644
index 69d1c89..0000000
--- a/crypto/kerberosIV/lib/krb/et_list.c
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the Kungliga Tekniska
- * Högskolan and its contributors.
- *
- * 4. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * This is a hack to resolve the reference to _et_list when making a
- * shared library under Psoriasis and possibly other systems. Presumably
- * they define __ELF__, some people say Linux does so.
- */
-
-#include "config.h"
-
-RCSID("$Id: et_list.c,v 1.12 1997/05/13 09:45:01 bg Exp $");
-
-struct et_list {
- struct et_list *next;
- const struct error_table *table;
-};
-
-#if defined(__GNUC__)
-
-#ifdef __FreeBSD__
-asm(".globl __et_list"); /* FreeBSD bug workaround */
-#endif
-struct et_list * _et_list __attribute__ ((weak)) = 0;
-
-#else /* !__GNUC__ */
-
-#ifdef HAVE_PRAGMA_WEAK
-
-#pragma weak _et_list = __et_list
-struct et_list * __et_list = 0;
-
-#else /* !HAVE_PRAGMA_WEAK */
-
-struct et_list * _et_list = 0;
-
-#endif /* !HAVE_PRAGMA_WEAK */
-
-#endif /* !__GNUC__ */
diff --git a/crypto/kerberosIV/lib/krb/gettimeofday.c b/crypto/kerberosIV/lib/krb/gettimeofday.c
deleted file mode 100644
index 734ca59..0000000
--- a/crypto/kerberosIV/lib/krb/gettimeofday.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the Kungliga Tekniska
- * Högskolan and its contributors.
- *
- * 4. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "krb_locl.h"
-RCSID("$Id: gettimeofday.c,v 1.5 1997/04/01 08:18:29 joda Exp $");
-
-#ifndef HAVE_GETTIMEOFDAY
-/*
- * Simple gettimeofday that only returns seconds.
- */
-int
-gettimeofday (struct timeval *tp, void *ignore)
-{
- time_t t;
-
- t = time(NULL);
- tp->tv_sec = t;
- tp->tv_usec = 0;
- return 0;
-}
-#endif
diff --git a/crypto/kerberosIV/lib/krb/k_concat.c b/crypto/kerberosIV/lib/krb/k_concat.c
deleted file mode 100644
index e7daa5f..0000000
--- a/crypto/kerberosIV/lib/krb/k_concat.c
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the Kungliga Tekniska
- * Högskolan and its contributors.
- *
- * 4. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "krb_locl.h"
-
-RCSID("$Id: k_concat.c,v 1.5 1997/05/02 08:56:39 joda Exp $");
-
-int
-k_concat (char *s, size_t len, ...)
-{
- int ret;
- va_list args;
-
- va_start(args, len);
- ret = k_vconcat (s, len, args);
- va_end(args);
- return ret;
-}
-
-int
-k_vconcat (char *s, size_t len, va_list args)
-{
- const char *a;
-
- while ((a = va_arg(args, const char*))) {
- size_t n = strlen (a);
-
- if (n >= len)
- return -1;
- strncpy (s, a, n);
- s += n;
- len -= n;
- }
- *s = '\0';
- return 0;
-}
-
-size_t
-k_vmconcat (char **s, size_t max_len, va_list args)
-{
- const char *a;
- char *p, *q;
- size_t len = 0;
- *s = NULL;
- p = malloc(1);
- if(p == NULL)
- return 0;
- *p = 0;
- len = 1;
- while ((a = va_arg(args, const char*))) {
- size_t n = strlen (a);
-
- if(max_len && len + n > max_len){
- free(p);
- return 0;
- }
- q = realloc(p, len + n);
- if(q == NULL){
- free(p);
- return 0;
- }
- p = q;
- len += n;
- strcat(p, a);
- }
- *s = p;
- return len;
-}
-
-size_t
-k_mconcat (char **s, size_t max_len, ...)
-{
- int ret;
- va_list args;
-
- va_start(args, max_len);
- ret = k_vmconcat (s, max_len, args);
- va_end(args);
- return ret;
-}
-
diff --git a/crypto/kerberosIV/lib/krb/k_flock.c b/crypto/kerberosIV/lib/krb/k_flock.c
deleted file mode 100644
index 844c34c..0000000
--- a/crypto/kerberosIV/lib/krb/k_flock.c
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the Kungliga Tekniska
- * Högskolan and its contributors.
- *
- * 4. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "krb_locl.h"
-
-RCSID("$Id: k_flock.c,v 1.8 1997/04/01 08:18:30 joda Exp $");
-
-#define K_OP_MASK (K_LOCK_SH | K_LOCK_EX | K_LOCK_UN)
-
-int
-k_flock(int fd, int operation)
-{
-#ifdef HAVE_FLOCK
- int op = 0;
- if (operation & K_LOCK_SH)
- op |= LOCK_SH;
- if (operation & K_LOCK_EX)
- op |= LOCK_EX;
- if (operation & K_LOCK_UN)
- op |= LOCK_UN;
- if (operation & K_LOCK_NB)
- op |= LOCK_NB;
-
- return flock(fd, op);
-#elif defined(HAVE_FCNTL) && defined(F_SETLK)
- struct flock arg;
- int code, cmd;
-
- arg.l_whence = SEEK_SET;
- arg.l_start = 0;
- arg.l_len = 0; /* means to EOF */
-
- if (operation & K_LOCK_NB)
- cmd = F_SETLK;
- else
- cmd = F_SETLKW; /* Blocking */
-
- switch (operation & K_OP_MASK) {
- case K_LOCK_UN:
- arg.l_type = F_UNLCK;
- code = fcntl(fd, F_SETLK, &arg);
- break;
- case K_LOCK_SH:
- arg.l_type = F_RDLCK;
- code = fcntl(fd, cmd, &arg);
- break;
- case K_LOCK_EX:
- arg.l_type = F_WRLCK;
- code = fcntl(fd, cmd, &arg);
- break;
- default:
- errno = EINVAL;
- code = -1;
- break;
- }
- return code;
-#else
- return -1;
-#endif /* !HAVE_FLOCK */
-}
diff --git a/crypto/kerberosIV/lib/krb/k_gethostname.c b/crypto/kerberosIV/lib/krb/k_gethostname.c
deleted file mode 100644
index 0f4d57f..0000000
--- a/crypto/kerberosIV/lib/krb/k_gethostname.c
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- Copyright (C) 1989 by the Massachusetts Institute of Technology
-
- Export of this software from the United States of America is assumed
- to require a specific license from the United States Government.
- It is the responsibility of any person or organization contemplating
- export to obtain such a license before exporting.
-
-WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
-distribute this software and its documentation for any purpose and
-without fee is hereby granted, provided that the above copyright
-notice appear in all copies and that both that copyright notice and
-this permission notice appear in supporting documentation, and that
-the name of M.I.T. not be used in advertising or publicity pertaining
-to distribution of the software without specific, written prior
-permission. M.I.T. makes no representations about the suitability of
-this software for any purpose. It is provided "as is" without express
-or implied warranty.
-
- */
-
-#include "krb_locl.h"
-RCSID("$Id: k_gethostname.c,v 1.10 1997/03/23 03:53:12 joda Exp $");
-
-#ifdef HAVE_SYS_UTSNAME_H
-#include <sys/utsname.h>
-#endif
-
-/*
- * Return the local host's name in "name", up to "namelen" characters.
- * "name" will be null-terminated if "namelen" is big enough.
- * The return code is 0 on success, -1 on failure. (The calling
- * interface is identical to gethostname(2).)
- */
-
-int
-k_gethostname(char *name, int namelen)
-{
-#if defined(HAVE_GETHOSTNAME)
- return gethostname(name, namelen);
-#elif defined(HAVE_UNAME)
- {
- struct utsname utsname;
- int ret;
-
- ret = uname (&utsname);
- if (ret < 0)
- return ret;
- strncpy (name, utsname.nodename, namelen);
- name[namelen-1] = '\0';
- return 0;
- }
-#else
- strncpy (name, "some.random.host", namelen);
- name[namelen-1] = '\0';
- return 0;
-#endif
-}
diff --git a/crypto/kerberosIV/lib/krb/krb.h b/crypto/kerberosIV/lib/krb/krb.h
index fca0bba..10f8c9b 100644
--- a/crypto/kerberosIV/lib/krb/krb.h
+++ b/crypto/kerberosIV/lib/krb/krb.h
@@ -1,5 +1,6 @@
/*
- * $Id: krb.h,v 1.99 1999/11/16 14:02:47 bg Exp $
+ * $Id: krb.h,v 1.97 1999/06/29 21:18:06 bg Exp $
+ * $FreeBSD$
*
* Copyright 1987, 1988 by the Massachusetts Institute of Technology.
*
@@ -14,7 +15,7 @@
#define signed
#endif
-#include <ktypes.h>
+#include <sys/types.h>
#include <time.h>
#ifndef __KRB_H__
@@ -92,19 +93,19 @@ extern const char *krb_err_txt[MAX_KRB_ERRORS];
/* /etc/kerberosIV is only for backwards compatibility, don't use it! */
#ifndef KRB_CONF
-#define KRB_CONF "/etc/krb.conf"
+#define KRB_CONF "/etc/kerberosIV/krb.conf"
#endif
#ifndef KRB_RLM_TRANS
-#define KRB_RLM_TRANS "/etc/krb.realms"
+#define KRB_RLM_TRANS "/etc/kerberosIV/krb.realms"
#endif
#ifndef KRB_CNF_FILES
-#define KRB_CNF_FILES { KRB_CONF, "/etc/kerberosIV/krb.conf", 0}
+#define KRB_CNF_FILES { KRB_CONF, "/etc/krb.conf", 0}
#endif
#ifndef KRB_RLM_FILES
-#define KRB_RLM_FILES { KRB_RLM_TRANS, "/etc/kerberosIV/krb.realms", 0}
+#define KRB_RLM_FILES { KRB_RLM_TRANS, "/etc/krb.realms", 0}
#endif
#ifndef KRB_EQUIV
-#define KRB_EQUIV "/etc/krb.equiv"
+#define KRB_EQUIV "/etc/kerberosIV/krb.equiv"
#endif
#define KRB_MASTER "kerberos"
#ifndef KRB_REALM
@@ -165,7 +166,7 @@ typedef struct ktext KTEXT_ST;
#define CLOCK_SKEW 5*60
/* Filename for readservkey */
#ifndef KEYFILE
-#define KEYFILE (krb_get_default_keyfile())
+#define KEYFILE "/etc/kerberosIV/srvtab"
#endif
/* Structure definition for rd_ap_req */
@@ -225,9 +226,7 @@ struct krb_host {
/* Location of ticket file for save_cred and get_cred */
#define TKT_FILE tkt_string()
-#ifndef TKT_ROOT
-#define TKT_ROOT (krb_get_default_tkt_root())
-#endif
+#define TKT_ROOT "/tmp/tkt"
/* Error codes returned from the KDC */
#define KDC_OK 0 /* Request OK */
diff --git a/crypto/kerberosIV/lib/krb/lsb_addr_comp.h b/crypto/kerberosIV/lib/krb/lsb_addr_comp.h
deleted file mode 100644
index 21adf06..0000000
--- a/crypto/kerberosIV/lib/krb/lsb_addr_comp.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * $Id: lsb_addr_comp.h,v 1.6 1996/10/05 00:18:02 joda Exp $
- *
- * Copyright 1988 by the Massachusetts Institute of Technology.
- *
- * For copying and distribution information, please see the file
- * <mit-copyright.h>.
- *
- * Comparison macros to emulate LSBFIRST comparison results of network
- * byte-order quantities
- */
-
-#ifndef LSB_ADDR_COMP_DEFS
-#define LSB_ADDR_COMP_DEFS
-
-/* Compare x and y in VAX byte order, result is -1, 0 or 1. */
-
-#define krb_lsb_antinet_ulong_less(x, y) (((x) == (y)) ? 0 : krb_lsb_antinet_ulong_cmp(x, y))
-
-#define krb_lsb_antinet_ushort_less(x, y) (((x) == (y)) ? 0 : krb_lsb_antinet_ushort_cmp(x, y))
-
-int krb_lsb_antinet_ulong_cmp(u_int32_t x, u_int32_t y);
-int krb_lsb_antinet_ushort_cmp(u_int16_t x, u_int16_t y);
-u_int32_t lsb_time(time_t t, struct sockaddr_in *src, struct sockaddr_in *dst);
-
-#endif /* LSB_ADDR_COMP_DEFS */
diff --git a/crypto/kerberosIV/lib/krb/netread.c b/crypto/kerberosIV/lib/krb/netread.c
deleted file mode 100644
index cbc1bd1..0000000
--- a/crypto/kerberosIV/lib/krb/netread.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- Copyright (C) 1989 by the Massachusetts Institute of Technology
-
- Export of this software from the United States of America is assumed
- to require a specific license from the United States Government.
- It is the responsibility of any person or organization contemplating
- export to obtain such a license before exporting.
-
-WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
-distribute this software and its documentation for any purpose and
-without fee is hereby granted, provided that the above copyright
-notice appear in all copies and that both that copyright notice and
-this permission notice appear in supporting documentation, and that
-the name of M.I.T. not be used in advertising or publicity pertaining
-to distribution of the software without specific, written prior
-permission. M.I.T. makes no representations about the suitability of
-this software for any purpose. It is provided "as is" without express
-or implied warranty.
-
- */
-
-#include "krb_locl.h"
-
-RCSID("$Id: netread.c,v 1.6 1997/03/23 03:53:15 joda Exp $");
-
-/*
- * krb_net_read() reads from the file descriptor "fd" to the buffer
- * "buf", until either 1) "len" bytes have been read or 2) cannot
- * read anymore from "fd". It returns the number of bytes read
- * or a read() error. (The calling interface is identical to
- * read(2).)
- *
- * XXX must not use non-blocking I/O
- */
-
-int
-krb_net_read (int fd, void *v, size_t len)
-{
- int cc, len2 = 0;
- char *buf = v;
-
- do {
- cc = read(fd, buf, len);
- if (cc < 0)
- return(cc); /* errno is already set */
- else if (cc == 0) {
- return(len2);
- } else {
- buf += cc;
- len2 += cc;
- len -= cc;
- }
- } while (len > 0);
- return(len2);
-}
diff --git a/crypto/kerberosIV/lib/krb/netwrite.c b/crypto/kerberosIV/lib/krb/netwrite.c
deleted file mode 100644
index 0703d91..0000000
--- a/crypto/kerberosIV/lib/krb/netwrite.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- Copyright (C) 1989 by the Massachusetts Institute of Technology
-
- Export of this software from the United States of America is assumed
- to require a specific license from the United States Government.
- It is the responsibility of any person or organization contemplating
- export to obtain such a license before exporting.
-
-WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
-distribute this software and its documentation for any purpose and
-without fee is hereby granted, provided that the above copyright
-notice appear in all copies and that both that copyright notice and
-this permission notice appear in supporting documentation, and that
-the name of M.I.T. not be used in advertising or publicity pertaining
-to distribution of the software without specific, written prior
-permission. M.I.T. makes no representations about the suitability of
-this software for any purpose. It is provided "as is" without express
-or implied warranty.
-
- */
-
-#include "krb_locl.h"
-
-RCSID("$Id: netwrite.c,v 1.7 1997/03/23 03:53:15 joda Exp $");
-
-/*
- * krb_net_write() writes "len" bytes from "buf" to the file
- * descriptor "fd". It returns the number of bytes written or
- * a write() error. (The calling interface is identical to
- * write(2).)
- *
- * XXX must not use non-blocking I/O
- */
-
-int
-krb_net_write(int fd, const void *v, size_t len)
-{
- int cc;
- int wrlen = len;
- const char *buf = (const char*)v;
-
- do {
- cc = write(fd, buf, wrlen);
- if (cc < 0)
- return(cc);
- else {
- buf += cc;
- wrlen -= cc;
- }
- } while (wrlen > 0);
- return(len);
-}
diff --git a/crypto/kerberosIV/lib/krb/resolve.c b/crypto/kerberosIV/lib/krb/resolve.c
deleted file mode 100644
index 7777c0e..0000000
--- a/crypto/kerberosIV/lib/krb/resolve.c
+++ /dev/null
@@ -1,288 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the Kungliga Tekniska
- * Högskolan and its contributors.
- *
- * 4. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "krb_locl.h"
-#include "resolve.h"
-
-RCSID("$Id: resolve.c,v 1.11 1997/06/01 04:19:20 assar Exp $");
-
-#if defined(HAVE_RES_SEARCH) && defined(HAVE_DN_EXPAND)
-
-#define DECL(X) {#X, T_##X}
-
-static struct stot{
- char *name;
- int type;
-}stot[] = {
- DECL(A),
- DECL(NS),
- DECL(CNAME),
- DECL(PTR),
- DECL(MX),
- DECL(TXT),
- DECL(AFSDB),
- DECL(SRV),
- {NULL, 0}
-};
-
-static int
-string_to_type(const char *name)
-{
- struct stot *p = stot;
- for(p = stot; p->name; p++)
- if(strcasecmp(name, p->name) == 0)
- return p->type;
- return -1;
-}
-
-#if 0
-static char *
-type_to_string(int type)
-{
- struct stot *p = stot;
- for(p = stot; p->name; p++)
- if(type == p->type)
- return p->name;
- return NULL;
-}
-#endif
-
-void
-dns_free_data(struct dns_reply *r)
-{
- struct resource_record *rr;
- if(r->q.domain)
- free(r->q.domain);
- for(rr = r->head; rr;){
- struct resource_record *tmp = rr;
- if(rr->domain)
- free(rr->domain);
- if(rr->u.data)
- free(rr->u.data);
- rr = rr->next;
- free(tmp);
- }
- free (r);
-}
-
-static struct dns_reply*
-parse_reply(unsigned char *data, int len)
-{
- unsigned char *p;
- char host[128];
- int status;
-
- struct dns_reply *r;
- struct resource_record **rr;
-
- r = (struct dns_reply*)malloc(sizeof(struct dns_reply));
- memset(r, 0, sizeof(struct dns_reply));
-
- p = data;
- memcpy(&r->h, p, sizeof(HEADER));
- p += sizeof(HEADER);
- status = dn_expand(data, data + len, p, host, sizeof(host));
- if(status < 0){
- dns_free_data(r);
- return NULL;
- }
- r->q.domain = strdup(host);
- p += status;
- r->q.type = (p[0] << 8 | p[1]);
- p += 2;
- r->q.class = (p[0] << 8 | p[1]);
- p += 2;
- rr = &r->head;
- while(p < data + len){
- int type, class, ttl, size;
- status = dn_expand(data, data + len, p, host, sizeof(host));
- if(status < 0){
- dns_free_data(r);
- return NULL;
- }
- p += status;
- type = (p[0] << 8) | p[1];
- p += 2;
- class = (p[0] << 8) | p[1];
- p += 2;
- ttl = (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3];
- p += 4;
- size = (p[0] << 8) | p[1];
- p += 2;
- *rr = (struct resource_record*)calloc(1,
- sizeof(struct resource_record));
- (*rr)->domain = strdup(host);
- (*rr)->type = type;
- (*rr)->class = class;
- (*rr)->ttl = ttl;
- (*rr)->size = size;
- switch(type){
- case T_NS:
- case T_CNAME:
- case T_PTR:
- status = dn_expand(data, data + len, p, host, sizeof(host));
- if(status < 0){
- dns_free_data(r);
- return NULL;
- }
- (*rr)->u.txt = strdup(host);
- break;
- case T_MX:
- case T_AFSDB:{
- status = dn_expand(data, data + len, p + 2, host, sizeof(host));
- if(status < 0){
- dns_free_data(r);
- return NULL;
- }
- (*rr)->u.mx = (struct mx_record*)malloc(sizeof(struct mx_record) +
- strlen(host));
- (*rr)->u.mx->preference = (p[0] << 8) | p[1];
- strcpy((*rr)->u.mx->domain, host);
- break;
- }
- case T_SRV:{
- status = dn_expand(data, data + len, p + 6, host, sizeof(host));
- if(status < 0){
- dns_free_data(r);
- return NULL;
- }
- (*rr)->u.srv =
- (struct srv_record*)malloc(sizeof(struct srv_record) +
- strlen(host));
- (*rr)->u.srv->priority = (p[0] << 8) | p[1];
- (*rr)->u.srv->weight = (p[2] << 8) | p[3];
- (*rr)->u.srv->port = (p[4] << 8) | p[5];
- strcpy((*rr)->u.srv->target, host);
- break;
- }
- case T_TXT:{
- (*rr)->u.txt = (char*)malloc(size + 1);
- strncpy((*rr)->u.txt, (char*)p + 1, *p);
- (*rr)->u.txt[*p] = 0;
- break;
- }
-
- default:
- (*rr)->u.data = (unsigned char*)malloc(size);
- memcpy((*rr)->u.data, p, size);
- }
- p += size;
- rr = &(*rr)->next;
- }
- *rr = NULL;
- return r;
-}
-
-
-
-struct dns_reply *
-dns_lookup(const char *domain, const char *type_name)
-{
- unsigned char reply[1024];
- int len;
- int type;
- struct dns_reply *r = NULL;
-
- type = string_to_type(type_name);
- len = res_search(domain, C_IN, type, reply, sizeof(reply));
- if(len >= 0)
- r = parse_reply(reply, len);
- return r;
-}
-
-#else /* defined(HAVE_RES_SEARCH) && defined(HAVE_DN_EXPAND) */
-
-struct dns_reply *
-dns_lookup(const char *domain, const char *type_name)
-{
- return NULL;
-}
-
-void
-dns_free_data(struct dns_reply *r)
-{
-}
-
-#endif
-
-#ifdef TEST
-
-int
-main(int argc, char **argv)
-{
- struct dns_reply *r;
- struct resource_record *rr;
- r = dns_lookup(argv[1], argv[2]);
- if(r == NULL){
- printf("No reply.\n");
- return 1;
- }
- for(rr = r->head; rr;rr=rr->next){
- printf("%s %s %d ", rr->domain, type_to_string(rr->type), rr->ttl);
- switch(rr->type){
- case T_NS:
- printf("%s\n", (char*)rr->data);
- break;
- case T_A:
- printf("%d.%d.%d.%d\n",
- ((unsigned char*)rr->data)[0],
- ((unsigned char*)rr->data)[1],
- ((unsigned char*)rr->data)[2],
- ((unsigned char*)rr->data)[3]);
- break;
- case T_MX:
- case T_AFSDB:{
- struct mx_record *mx = (struct mx_record*)rr->data;
- printf("%d %s\n", mx->preference, mx->domain);
- break;
- }
- case T_SRV:{
- struct srv_record *srv = (struct srv_record*)rr->data;
- printf("%d %d %d %s\n", srv->priority, srv->weight,
- srv->port, srv->target);
- break;
- }
- default:
- printf("\n");
- break;
- }
- }
-
- return 0;
-}
-#endif
diff --git a/crypto/kerberosIV/lib/krb/resolve.h b/crypto/kerberosIV/lib/krb/resolve.h
deleted file mode 100644
index dac9993..0000000
--- a/crypto/kerberosIV/lib/krb/resolve.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the Kungliga Tekniska
- * Högskolan and its contributors.
- *
- * 4. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* $Id: resolve.h,v 1.5 1997/05/14 17:41:25 joda Exp $ */
-
-/* THIS IS NOT (yet) A PUBLIC INTERFACE */
-
-
-#ifndef __RESOLVE_H__
-#define __RESOLVE_H__
-
-/* We use these, but they are not always present in <arpa/nameser.h> */
-
-#ifndef T_TXT
-#define T_TXT 16
-#endif
-#ifndef T_AFSDB
-#define T_AFSDB 18
-#endif
-#ifndef T_SRV
-#define T_SRV 33
-#endif
-
-struct dns_query{
- char *domain;
- unsigned type;
- unsigned class;
-};
-
-struct mx_record{
- unsigned preference;
- char domain[1];
-};
-
-struct srv_record{
- unsigned priority;
- unsigned weight;
- unsigned port;
- char target[1];
-};
-
-struct resource_record{
- char *domain;
- unsigned type;
- unsigned class;
- unsigned ttl;
- unsigned size;
- union {
- void *data;
- struct mx_record *mx;
- struct mx_record *afsdb; /* mx and afsdb are identical */
- struct srv_record *srv;
- struct in_addr *a;
- char *txt;
- }u;
- struct resource_record *next;
-};
-
-
-#ifndef HAVE_ARPA_NAMESER_H /* XXX */
-typedef int HEADER; /* will never be used */
-#endif
-
-struct dns_reply{
- HEADER h;
- struct dns_query q;
- struct resource_record *head;
-};
-
-
-struct dns_reply* dns_lookup(const char *, const char *);
-
-void dns_free_data(struct dns_reply *r);
-
-#endif /* __RESOLVE_H__ */
diff --git a/crypto/kerberosIV/lib/krb/swab.c b/crypto/kerberosIV/lib/krb/swab.c
deleted file mode 100644
index d68ce3d..0000000
--- a/crypto/kerberosIV/lib/krb/swab.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the Kungliga Tekniska
- * Högskolan and its contributors.
- *
- * 4. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-RCSID("$Id: swab.c,v 1.4 1997/04/01 08:18:45 joda Exp $");
-#endif
-
-#ifndef HAVE_SWAB
-void
-swab (char *from, char *to, int nbytes)
-{
- while(nbytes >= 2) {
- *(to + 1) = *from;
- *to = *(from + 1);
- to += 2;
- from += 2;
- nbytes -= 2;
- }
-}
-#endif
diff --git a/crypto/kerberosIV/lib/krb/util.c b/crypto/kerberosIV/lib/krb/util.c
deleted file mode 100644
index 7b77bb8..0000000
--- a/crypto/kerberosIV/lib/krb/util.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- *
- * Copyright 1988 by the Massachusetts Institute of Technology.
- *
- * For copying and distribution information, please see the file
- * <mit-copyright.h>.
- *
- * Miscellaneous debug printing utilities
- */
-
-#include "krb_locl.h"
-
-RCSID("$Id: util.c,v 1.6 1996/10/05 00:18:34 joda Exp $");
-
-/*
- * Print some of the contents of the given authenticator structure
- * (AUTH_DAT defined in "krb.h"). Fields printed are:
- *
- * pname, pinst, prealm, netaddr, flags, cksum, timestamp, session
- */
-
-void
-ad_print(AUTH_DAT *x)
-{
- /*
- * Print the contents of an auth_dat struct.
- */
- struct in_addr address;
- address.s_addr = x->address;
- printf("\n%s %s %s %s flags %u cksum 0x%X\n\ttkt_tm 0x%X sess_key",
- x->pname, x->pinst, x->prealm,
- inet_ntoa(address), x->k_flags,
- x->checksum, x->time_sec);
- printf("[8] =");
-#ifdef NOENCRYPTION
- placebo_cblock_print(x->session);
-#else
- des_cblock_print_file(&x->session,stdout);
-#endif
- /* skip reply for now */
-}
-
-/*
- * Print in hex the 8 bytes of the given session key.
- *
- * Printed format is: " 0x { x, x, x, x, x, x, x, x }"
- */
-
-#ifdef NOENCRYPTION
-placebo_cblock_print(x)
- des_cblock x;
-{
- unsigned char *y = (unsigned char *) x;
- int i = 0;
-
- printf(" 0x { ");
-
- while (i++ <8) {
- printf("%x",*y++);
- if (i<8) printf(", ");
- }
- printf(" }");
-}
-#endif
diff --git a/crypto/kerberosIV/lib/roken/roken.h b/crypto/kerberosIV/lib/roken/roken.h
deleted file mode 100644
index 1204e3e..0000000
--- a/crypto/kerberosIV/lib/roken/roken.h
+++ /dev/null
@@ -1,338 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the Kungliga Tekniska
- * Högskolan and its contributors.
- *
- * 4. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* $Id: roken.h,v 1.63 1997/05/28 05:38:09 assar Exp $ */
-
-#ifndef __ROKEN_H__
-#define __ROKEN_H__
-
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <signal.h>
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#ifdef HAVE_GRP_H
-#include <grp.h>
-#endif
-#ifdef HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
-#ifdef HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-
-#ifdef HAVE_TERMIOS_H
-#include <termios.h>
-#endif
-
-#if defined(HAVE_SYS_IOCTL_H) && SunOS != 4
-#include <sys/ioctl.h>
-#endif
-
-#include "protos.h"
-
-#if !defined(HAVE_SETSID) && defined(HAVE__SETSID)
-#define setsid _setsid
-#endif
-
-#ifndef HAVE_PUTENV
-int putenv(const char *string);
-#endif
-
-#ifndef HAVE_SETENV
-int setenv(const char *var, const char *val, int rewrite);
-#endif
-
-#ifndef HAVE_UNSETENV
-void unsetenv(const char *name);
-#endif
-
-#ifndef HAVE_GETUSERSHELL
-char *getusershell(void);
-#endif
-
-#if !defined(__GNUC__) && !defined(__attribute__)
-#define __attribute__(x)
-#endif
-
-#ifndef HAVE_SNPRINTF
-int snprintf (char *str, size_t sz, const char *format, ...)
- __attribute__ ((format (printf, 3, 4)));
-#endif
-
-#ifndef HAVE_VSNPRINTF
-int vsnprintf (char *str, size_t sz, const char *format, va_list ap)
- __attribute__((format (printf, 3, 0)));
-#endif
-
-#ifndef HAVE_ASPRINTF
-int asprintf (char **ret, const char *format, ...)
- __attribute__ ((format (printf, 2, 3)));
-#endif
-
-#ifndef HAVE_VASPRINTF
-int vasprintf (char **ret, const char *format, va_list ap)
- __attribute__((format (printf, 2, 0)));
-#endif
-
-#ifndef HAVE_ASNPRINTF
-int asnprintf (char **ret, size_t max_sz, const char *format, ...)
- __attribute__ ((format (printf, 3, 4)));
-#endif
-
-#ifndef HAVE_VASNPRINTF
-int vasnprintf (char **ret, size_t max_sz, const char *format, va_list ap)
- __attribute__((format (printf, 3, 0)));
-#endif
-
-#ifndef HAVE_STRDUP
-char * strdup(const char *old);
-#endif
-
-#ifndef HAVE_STRLWR
-char * strlwr(char *);
-#endif
-
-#ifndef HAVE_STRNLEN
-int strnlen(char*, int);
-#endif
-
-#ifndef HAVE_STRTOK_R
-char *strtok_r(char *s1, const char *s2, char **lasts);
-#endif
-
-#ifndef HAVE_STRUPR
-char * strupr(char *);
-#endif
-
-#ifndef HAVE_GETDTABLESIZE
-int getdtablesize(void);
-#endif
-
-#if IRIX != 4 /* fix for compiler bug */
-#ifdef RETSIGTYPE
-typedef RETSIGTYPE (*SigAction)(/* int??? */);
-SigAction signal(int iSig, SigAction pAction); /* BSD compatible */
-#endif
-#endif
-
-#ifndef SIG_ERR
-#define SIG_ERR ((RETSIGTYPE (*)())-1)
-#endif
-
-#if !defined(HAVE_STRERROR) && !defined(strerror)
-char *strerror(int eno);
-#endif
-
-#ifndef HAVE_HSTRERROR
-char *hstrerror(int herr);
-#endif
-
-#ifndef HAVE_H_ERRNO_DECLARATION
-extern int h_errno;
-#endif
-
-#ifndef HAVE_INET_ATON
-/* Minimal implementation of inet_aton. Doesn't handle hex numbers. */
-int inet_aton(const char *cp, struct in_addr *adr);
-#endif
-
-#if !defined(HAVE_GETCWD)
-char* getcwd(char *path, size_t size);
-#endif
-
-#ifndef HAVE_GETENT
-int getent(char *cp, char *name);
-#endif
-
-#ifdef HAVE_PWD_H
-#include <pwd.h>
-struct passwd *k_getpwnam (char *user);
-struct passwd *k_getpwuid (uid_t uid);
-#endif
-
-#ifndef HAVE_SETEUID
-int seteuid(int euid);
-#endif
-
-#ifndef HAVE_SETEGID
-int setegid(int egid);
-#endif
-
-#ifndef HAVE_LSTAT
-int lstat(const char *path, struct stat *buf);
-#endif
-
-#ifndef HAVE_MKSTEMP
-int mkstemp(char *);
-#endif
-
-#ifndef HAVE_INITGROUPS
-int initgroups(const char *name, gid_t basegid);
-#endif
-
-#ifndef HAVE_FCHOWN
-int fchown(int fd, uid_t owner, gid_t group);
-#endif
-
-#ifndef HAVE_CHOWN
-int chown(const char *path, uid_t owner, gid_t group);
-#endif
-
-#ifndef HAVE_RCMD
-int rcmd(char **ahost, unsigned short inport, const char *locuser,
- const char *remuser, const char *cmd, int *fd2p);
-#endif
-
-#ifdef TIME_WITH_SYS_TIME
-#include <sys/time.h>
-#include <time.h>
-#elif defined(HAVE_SYS_TIME_H)
-#include <sys/time.h>
-#else
-#include <time.h>
-#endif
-
-time_t tm2time (struct tm tm, int local);
-
-int unix_verify_user(char *user, char *password);
-
-void inaddr2str(struct in_addr addr, char *s, size_t len);
-
-void mini_inetd (int port);
-
-#ifndef HAVE_STRUCT_WINSIZE
-struct winsize {
- unsigned short ws_row, ws_col;
- unsigned short ws_xpixel, ws_ypixel;
-};
-#endif
-
-int get_window_size(int fd, struct winsize *);
-
-#ifndef INADDR_NONE
-#define INADDR_NONE 0xffffffff
-#endif
-
-#ifndef SOMAXCONN
-#define SOMAXCONN 5
-#endif
-
-#ifndef STDIN_FILENO
-#define STDIN_FILENO 0
-#endif
-
-#ifndef STDOUT_FILENO
-#define STDOUT_FILENO 1
-#endif
-
-#ifndef STDERR_FILENO
-#define STDERR_FILENO 2
-#endif
-
-#ifndef max
-#define max(a,b) (((a)>(b))?(a):(b))
-#endif
-
-#ifndef min
-#define min(a,b) (((a)<(b))?(a):(b))
-#endif
-
-#ifndef TRUE
-#define TRUE 1
-#endif
-
-#ifndef FALSE
-#define FALSE 0
-#endif
-
-#ifdef HAVE_SYSLOG_H
-#include <syslog.h>
-/* Misc definitions for old syslogs */
-
-#ifndef LOG_DAEMON
-#define openlog(id,option,facility) openlog((id),(option))
-#define LOG_DAEMON 0
-#endif
-#ifndef LOG_ODELAY
-#define LOG_ODELAY 0
-#endif
-#ifndef LOG_NDELAY
-#define LOG_NDELAY 0x08
-#endif
-#ifndef LOG_CONS
-#define LOG_CONS 0
-#endif
-#ifndef LOG_AUTH
-#define LOG_AUTH 0
-#endif
-#ifndef LOG_AUTHPRIV
-#define LOG_AUTHPRIV LOG_AUTH
-#endif
-#endif
-
-#ifndef HAVE_OPTARG_DECLARATION
-extern char *optarg;
-#endif
-#ifndef HAVE_OPTIND_DECLARATION
-extern int optind;
-#endif
-#ifndef HAVE_OPTERR_DECLARATION
-extern int opterr;
-#endif
-
-#ifndef HAVE___PROGNAME_DECLARATION
-extern const char *__progname;
-#endif
-
-void set_progname(char *argv0);
-
-#ifdef HAVE_PATHS_H
-#include <paths.h>
-#endif
-
-#ifndef _PATH_DEVNULL
-#define _PATH_DEVNULL "/dev/null"
-#endif
-
-#endif /* __ROKEN_H__ */
OpenPOWER on IntegriCloud