summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohn Kohl <jtkohl@mit.edu>1990-12-14 18:26:22 +0000
committerJohn Kohl <jtkohl@mit.edu>1990-12-14 18:26:22 +0000
commite1772c824f6bd353311dab839c7f985a86004cb4 (patch)
tree0a637803d08444b8209db762384561d759390e32 /src
parent66163bda83a0e10bf2bdd834863dd7e1c6283355 (diff)
downloadkrb5-e1772c824f6bd353311dab839c7f985a86004cb4.tar.gz
krb5-e1772c824f6bd353311dab839c7f985a86004cb4.tar.xz
krb5-e1772c824f6bd353311dab839c7f985a86004cb4.zip
*** empty log message ***
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@1553 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src')
-rw-r--r--src/include/krb5/safepriv.h25
-rw-r--r--src/lib/krb5/asn.1/ktran2tran.c52
-rw-r--r--src/lib/krb5/asn.1/tran2ktran.c55
-rw-r--r--src/lib/krb5/free/f_arep_enc.c30
-rw-r--r--src/lib/krb5/free/f_padata.c35
-rw-r--r--src/lib/krb5/krb/pr_to_salt.c54
6 files changed, 251 insertions, 0 deletions
diff --git a/src/include/krb5/safepriv.h b/src/include/krb5/safepriv.h
new file mode 100644
index 000000000..a9898ca61
--- /dev/null
+++ b/src/include/krb5/safepriv.h
@@ -0,0 +1,25 @@
+/*
+ * $Source$
+ * $Author$
+ * $Id$
+ *
+ * Copyright 1990 by the Massachusetts Institute of Technology.
+ *
+ * For copying and distribution information, please see the file
+ * <krb5/copyright.h>.
+ *
+ * #defines for SAFE and PRIV message options.
+ */
+
+#include <krb5/copyright.h>
+
+#ifndef KRB5_SAFE_PRIV__
+#define KRB5_SAFE_PRIV__
+
+#define KRB5_SAFE_NOTIME 0x1
+#define KRB5_SAFE_DOSEQUENCE 0x2
+
+#define KRB5_PRIV_NOTIME 0x1
+#define KRB5_PRIV_DOSEQUENCE 0x2
+
+#endif /* KRB5_SAFE_PRIV__ */
diff --git a/src/lib/krb5/asn.1/ktran2tran.c b/src/lib/krb5/asn.1/ktran2tran.c
new file mode 100644
index 000000000..5b038c09b
--- /dev/null
+++ b/src/lib/krb5/asn.1/ktran2tran.c
@@ -0,0 +1,52 @@
+/*
+ * $Source$
+ * $Author$
+ *
+ * Copyright 1989,1990 by the Massachusetts Institute of Technology.
+ *
+ * For copying and distribution information, please see the file
+ * <krb5/copyright.h>.
+ *
+ * Glue between Kerberos version and ISODE 6.0 version of structures.
+ */
+
+#if !defined(lint) && !defined(SABER)
+static char rcsid_ktran2tran_c[] =
+"$Id$";
+#endif /* lint || saber */
+
+#include <krb5/copyright.h>
+#include <krb5/krb5.h>
+
+/*#include <time.h> */
+#include <isode/psap.h>
+#include <krb5/asn1.h>
+#include "asn1glue.h"
+
+#include <krb5/ext-proto.h>
+
+/* ISODE defines max(a,b) */
+
+struct type_KRB5_TransitedEncoding *
+krb5_transited2KRB5_TransitedEncoding(val, error)
+const register krb5_transited *val;
+register int *error;
+{
+ register struct type_KRB5_TransitedEncoding *retval;
+
+ retval = (struct type_KRB5_TransitedEncoding *)xmalloc(sizeof(*retval));
+ if (!retval) {
+ *error = ENOMEM;
+ return(0);
+ }
+ xbzero(retval, sizeof(*retval));
+
+ retval->tr__type = val->tr_type;
+ retval->contents = krb5_data2qbuf(&val->tr_contents);
+ if (!retval->contents) {
+ *error = ENOMEM;
+ free_KRB5_TransitedEncoding(retval);
+ return(0);
+ }
+ return(retval);
+}
diff --git a/src/lib/krb5/asn.1/tran2ktran.c b/src/lib/krb5/asn.1/tran2ktran.c
new file mode 100644
index 000000000..bba95123b
--- /dev/null
+++ b/src/lib/krb5/asn.1/tran2ktran.c
@@ -0,0 +1,55 @@
+/*
+ * $Source$
+ * $Author$
+ *
+ * Copyright 1989,1990 by the Massachusetts Institute of Technology.
+ *
+ * For copying and distribution information, please see the file
+ * <krb5/copyright.h>.
+ *
+ * Glue between Kerberos version and ISODE 6.0 version of structures.
+ */
+
+#if !defined(lint) && !defined(SABER)
+static char rcsid_tran2ktran_c[] =
+"$Id$";
+#endif /* lint || saber */
+
+#include <krb5/copyright.h>
+#include <krb5/krb5.h>
+
+/*#include <time.h> */
+#include <isode/psap.h>
+#include <krb5/asn1.h>
+#include "asn1glue.h"
+
+#include <krb5/ext-proto.h>
+
+/* ISODE defines max(a,b) */
+
+krb5_transited *
+KRB5_TransitedEncoding2krb5_transited(val, error)
+const register struct type_KRB5_TransitedEncoding *val;
+register int *error;
+{
+ register krb5_transited *retval;
+ krb5_data *temp;
+
+ retval = (krb5_transited *)xmalloc(sizeof(*retval));
+ if (!retval) {
+ *error = ENOMEM;
+ return(0);
+ }
+ xbzero(retval, sizeof(*retval));
+
+ retval->tr_type = val->tr__type;
+ temp = qbuf2krb5_data(val->contents, error);
+ if (temp) {
+ retval->tr_contents = *temp;
+ xfree(temp);
+ } else {
+ xfree(retval);
+ return(0);
+ }
+ return(retval);
+}
diff --git a/src/lib/krb5/free/f_arep_enc.c b/src/lib/krb5/free/f_arep_enc.c
new file mode 100644
index 000000000..be70cb1ee
--- /dev/null
+++ b/src/lib/krb5/free/f_arep_enc.c
@@ -0,0 +1,30 @@
+/*
+ * $Source$
+ * $Author$
+ *
+ * Copyright 1990 by the Massachusetts Institute of Technology.
+ *
+ * For copying and distribution information, please see the file
+ * <krb5/copyright.h>.
+ *
+ * krb5_free_ap_rep_enc_part()
+ */
+
+#if !defined(lint) && !defined(SABER)
+static char rcsid_f_arep_enc_c [] =
+"$Id$";
+#endif /* !lint & !SABER */
+
+#include <krb5/copyright.h>
+#include <krb5/krb5.h>
+#include <krb5/ext-proto.h>
+
+void
+krb5_free_ap_rep_enc_part(val)
+krb5_ap_rep_enc_part *val;
+{
+ if (val->subkey)
+ krb5_free_keyblock(val->subkey);
+ xfree(val);
+ return;
+}
diff --git a/src/lib/krb5/free/f_padata.c b/src/lib/krb5/free/f_padata.c
new file mode 100644
index 000000000..346fd722a
--- /dev/null
+++ b/src/lib/krb5/free/f_padata.c
@@ -0,0 +1,35 @@
+/*
+ * $Source$
+ * $Author$
+ *
+ * Copyright 1990 by the Massachusetts Institute of Technology.
+ *
+ * For copying and distribution information, please see the file
+ * <krb5/copyright.h>.
+ *
+ * krb5_free_padata()
+ */
+
+#if !defined(lint) && !defined(SABER)
+static char rcsid_f_padata_c [] =
+"$Id$";
+#endif /* !lint & !SABER */
+
+#include <krb5/copyright.h>
+#include <krb5/krb5.h>
+#include <krb5/ext-proto.h>
+
+void
+krb5_free_pa_data(val)
+krb5_pa_data **val;
+{
+ register krb5_pa_data **temp;
+
+ for (temp = val; *temp; temp++) {
+ if ((*temp)->contents)
+ xfree((*temp)->contents);
+ xfree(*temp);
+ }
+ xfree(val);
+ return;
+}
diff --git a/src/lib/krb5/krb/pr_to_salt.c b/src/lib/krb5/krb/pr_to_salt.c
new file mode 100644
index 000000000..40602026b
--- /dev/null
+++ b/src/lib/krb5/krb/pr_to_salt.c
@@ -0,0 +1,54 @@
+/*
+ * $Source$
+ * $Author$
+ *
+ * Copyright 1990 by the Massachusetts Institute of Technology.
+ *
+ * For copying and distribution information, please see the file
+ * <krb5/copyright.h>.
+ *
+ * krb5_principal2salt()
+ */
+
+#if !defined(lint) && !defined(SABER)
+static char rcsid_pr_to_salt_c[] =
+"$Id$";
+#endif /* !lint & !SABER */
+
+#include <krb5/copyright.h>
+
+#include <krb5/krb5.h>
+#include <krb5/ext-proto.h>
+
+/*
+ * Convert a krb5_principal into the default salt for that principal.
+ */
+
+krb5_error_code
+krb5_principal2salt(pr, ret)
+krb5_const_principal pr;
+krb5_data *ret;
+{
+ int size, offset;
+ krb5_data **prp;
+
+
+ if (pr == 0) {
+ ret->length = 0;
+ ret->data = 0;
+ } else {
+ for (size = 0, prp = pr; *prp; prp++)
+ size += (*prp)->length;
+
+ ret->length = size;
+ if (!(ret->data = malloc (size+1)))
+ return ENOMEM;
+
+ for (offset=0, prp=pr; *prp; prp++)
+ {
+ memcpy(&ret->data[offset],(*prp)->data, (*prp)->length);
+ offset += (*prp)->length;
+ }
+ }
+ return 0;
+}