summaryrefslogtreecommitdiffstats
path: root/src/lib/crypto/des/afsstring2key.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/crypto/des/afsstring2key.c')
-rw-r--r--src/lib/crypto/des/afsstring2key.c32
1 files changed, 29 insertions, 3 deletions
diff --git a/src/lib/crypto/des/afsstring2key.c b/src/lib/crypto/des/afsstring2key.c
index 36c42c482..7eac0807c 100644
--- a/src/lib/crypto/des/afsstring2key.c
+++ b/src/lib/crypto/des/afsstring2key.c
@@ -6,6 +6,32 @@
* constructed by Mark Eichin, Cygnus Support, 1995.
*/
+/*
+ * 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"
#include <ctype.h>
@@ -13,8 +39,7 @@
static char *afs_crypt PROTOTYPE((char*,char*));
krb5_error_code
-mit_afs_string_to_key (eblock, keyblock, data, salt)
- const krb5_encrypt_block FAR * eblock;
+mit_afs_string_to_key (keyblock, data, salt)
krb5_keyblock FAR * keyblock;
const krb5_data FAR * data;
const krb5_data FAR * salt;
@@ -29,7 +54,7 @@ mit_afs_string_to_key (eblock, keyblock, data, salt)
register krb5_octet *key = keyblock->contents;
if (data->length <= 8) {
- char password[9]; /* trailing null for crypt() */
+ char password[9]; /* trailing nul for crypt() */
strncpy(password, realm, 8);
for (i=0; i<8; i++)
if (isupper(password[i]))
@@ -39,6 +64,7 @@ mit_afs_string_to_key (eblock, keyblock, data, salt)
for (i=0; i<8; i++)
if (password[i] == '\0')
password[i] = 'X';
+ password[8] = '\0';
strncpy(key, (char *) afs_crypt(password, "#~") + 2, 8);
for (i=0; i<8; i++)
key[i] <<= 1;