summaryrefslogtreecommitdiffstats
path: root/src/lib/crypto/des/string2key.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/crypto/des/string2key.c')
-rw-r--r--src/lib/crypto/des/string2key.c40
1 files changed, 28 insertions, 12 deletions
diff --git a/src/lib/crypto/des/string2key.c b/src/lib/crypto/des/string2key.c
index 8a2b1415b7..79b7c9cbd8 100644
--- a/src/lib/crypto/des/string2key.c
+++ b/src/lib/crypto/des/string2key.c
@@ -21,6 +21,32 @@
* or implied warranty.
*/
+/*
+ * Copyright (C) 1998 by the FundsXpress, INC.
+ *
+ * All rights reserved.
+ *
+ * Export of this software from the United States of America may 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 FundsXpress. not be used in advertising or publicity pertaining
+ * to distribution of the software without specific, written prior
+ * permission. FundsXpress makes no representations about the suitability of
+ * this software for any purpose. It is provided "as is" without express
+ * or implied warranty.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ */
+
#include "k5-int.h"
#include "des_int.h"
@@ -41,8 +67,7 @@
*/
krb5_error_code
-mit_des_string_to_key (eblock, keyblock, data, salt)
-const krb5_encrypt_block FAR * eblock;
+mit_des_string_to_key_int (keyblock, data, salt)
krb5_keyblock FAR * keyblock;
const krb5_data FAR * data;
const krb5_data FAR * salt;
@@ -59,28 +84,19 @@ const krb5_data FAR * salt;
register char *p_char;
char k_char[64];
mit_des_key_schedule key_sked;
- krb5_enctype enctype = eblock->crypto_entry->proto_enctype;
#ifndef min
#define min(A, B) ((A) < (B) ? (A): (B))
#endif
- if ((enctype != ENCTYPE_DES_CBC_CRC) && (enctype != ENCTYPE_DES_CBC_MD4) &&
- (enctype != ENCTYPE_DES_CBC_MD5) && (enctype != ENCTYPE_DES_CBC_RAW))
- return (KRB5_PROG_ETYPE_NOSUPP);
-
- if ( !(keyblock->contents = (krb5_octet *)malloc(sizeof(mit_des_cblock))) )
- return(ENOMEM);
-
keyblock->magic = KV5M_KEYBLOCK;
keyblock->length = sizeof(mit_des_cblock);
- keyblock->enctype = eblock->crypto_entry->proto_enctype;
key = keyblock->contents;
if (salt) {
if (salt->length == -1) {
/* cheat and do AFS string2key instead */
- return mit_afs_string_to_key (eblock, keyblock, data, salt);
+ return mit_afs_string_to_key (keyblock, data, salt);
} else
length = data->length + salt->length;
}