*** empty log message ***
authorJohn Kohl <jtkohl@mit.edu>
Tue, 9 Oct 1990 16:33:13 +0000 (16:33 +0000)
committerJohn Kohl <jtkohl@mit.edu>
Tue, 9 Oct 1990 16:33:13 +0000 (16:33 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@1170 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/asn.1/edat2kedat.c [new file with mode: 0644]
src/lib/krb5/asn.1/kedat2edat.c [new file with mode: 0644]

diff --git a/src/lib/krb5/asn.1/edat2kedat.c b/src/lib/krb5/asn.1/edat2kedat.c
new file mode 100644 (file)
index 0000000..c5d2f3f
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * $Source$
+ * $Author$
+ *
+ * Copyright 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_edat2kedat_c[] =
+"$Id$";
+#endif /* lint || saber */
+
+#include <krb5/copyright.h>
+#include <krb5/krb5.h>
+
+/*#include <time.h> */
+#include <isode/psap.h>
+#include "KRB5-types.h"
+#include "asn1glue.h"
+#include "asn1defs.h"
+
+#include <krb5/ext-proto.h>
+
+/* ISODE defines max(a,b) */
+
+krb5_enc_data *
+KRB5_EncryptedData2krb5_enc_data(val, error)
+const register struct type_KRB5_EncryptedData *val;
+register int *error;
+{
+    register krb5_enc_data *retval;
+    krb5_data *temp;
+
+    retval = (krb5_enc_data *)xmalloc(sizeof(*retval));
+    if (!retval) {
+       *error = ENOMEM;
+       return(0);
+    }
+    xbzero(retval, sizeof(*retval));
+
+    temp = qbuf2krb5_data(val->cipher, error);
+    if (temp) {
+       retval->ciphertext = *temp;
+       xfree(temp);
+    } else {
+       xfree(retval);
+       return(0);
+    }
+    if (val->optionals & opt_KRB5_EncryptedData_kvno)
+       retval->kvno = val->kvno;
+    retval->etype = val->etype;
+    return(retval);
+}
diff --git a/src/lib/krb5/asn.1/kedat2edat.c b/src/lib/krb5/asn.1/kedat2edat.c
new file mode 100644 (file)
index 0000000..c154a7d
--- /dev/null
@@ -0,0 +1,57 @@
+/*
+ * $Source$
+ * $Author$
+ *
+ * Copyright 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_kedat2edat_c[] =
+"$Id$";
+#endif /* lint || saber */
+
+#include <krb5/copyright.h>
+#include <krb5/krb5.h>
+
+/*#include <time.h> */
+#include <isode/psap.h>
+#include "KRB5-types.h"
+#include "asn1glue.h"
+#include "asn1defs.h"
+
+#include <krb5/ext-proto.h>
+
+/* ISODE defines max(a,b) */
+
+struct type_KRB5_EncryptedData *
+krb5_enc_data2KRB5_EncryptedData(val, error)
+const register krb5_enc_data *val;
+register int *error;
+{
+    register struct type_KRB5_EncryptedData *retval;
+    retval = (struct type_KRB5_EncryptedData *)xmalloc(sizeof(*retval));
+    if (!retval) {
+       *error = ENOMEM;
+       return(0);
+    }
+    xbzero(retval, sizeof(*retval));
+
+    retval->etype = val->etype;
+    retval->cipher = krb5_data2qbuf(&(val->ciphertext));
+    if (!retval->cipher) {
+       xfree(retval);
+       *error = ENOMEM;
+       return(0);
+    }
+    if (val->kvno) {
+       retval->optionals = opt_KRB5_EncryptedData_kvno;
+       retval->kvno = val->kvno;
+    }
+    return(retval);
+}