summaryrefslogtreecommitdiffstats
path: root/src/lib/crypto/openssl/des/string2key.c
diff options
context:
space:
mode:
authorZhanna Tsitkov <tsitkova@mit.edu>2009-10-01 21:46:57 +0000
committerZhanna Tsitkov <tsitkova@mit.edu>2009-10-01 21:46:57 +0000
commit97d243197bbb85b50f1376f2138dd9724e203ce1 (patch)
tree33c6c8a9b80907abb645ef4a28f1f015798243d9 /src/lib/crypto/openssl/des/string2key.c
parent5a6591a55067239663a264b3d6ab8d3572e15551 (diff)
downloadkrb5-97d243197bbb85b50f1376f2138dd9724e203ce1.tar.gz
krb5-97d243197bbb85b50f1376f2138dd9724e203ce1.tar.xz
krb5-97d243197bbb85b50f1376f2138dd9724e203ce1.zip
Crypto modularity proj: Populate openssl/des dir.
To avoid breaking the export list some functions (mostly mit_xxx) are left in place with the disabled functionality. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22821 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib/crypto/openssl/des/string2key.c')
-rw-r--r--src/lib/crypto/openssl/des/string2key.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/lib/crypto/openssl/des/string2key.c b/src/lib/crypto/openssl/des/string2key.c
new file mode 100644
index 000000000..775a15364
--- /dev/null
+++ b/src/lib/crypto/openssl/des/string2key.c
@@ -0,0 +1,26 @@
+/*
+ * lib/crypto/openssl/des/string2key.c
+ *
+ * Copyright 2009 by the Massachusetts Institute
+ * of Technology.
+ * All Rights Reserved.
+ *
+ */
+
+#include "des_int.h"
+#include <openssl/des.h>
+
+
+krb5_error_code
+mit_des_string_to_key_int (krb5_keyblock *key,
+ const krb5_data *pw, const krb5_data *salt)
+{
+ DES_cblock outkey;
+ DES_string_to_key(pw->data, &outkey);
+ if ( key->length < sizeof(outkey))
+ return KRB5_CRYPTO_INTERNAL;
+ key->length = sizeof(outkey);
+ memcpy(key->contents, outkey, key->length);
+ return 0;
+}
+