From 1dadd06067acbf21ce1bd2ca73c082b21f907579 Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Jan 11 2012 17:04:23 +0000 Subject: Remove ipa_get_random_salt() from ipapwd_encoding.c This appeared only in the 2.1 branch and is not needed --- diff --git a/daemons/ipa-slapi-plugins/ipa-pwd-extop/ipapwd_encoding.c b/daemons/ipa-slapi-plugins/ipa-pwd-extop/ipapwd_encoding.c index e11caef..8e59e19 100644 --- a/daemons/ipa-slapi-plugins/ipa-pwd-extop/ipapwd_encoding.c +++ b/daemons/ipa-slapi-plugins/ipa-pwd-extop/ipapwd_encoding.c @@ -102,36 +102,6 @@ void ipapwd_keyset_free(struct ipapwd_keyset **pkset) *pkset = NULL; } -static krb5_error_code ipa_get_random_salt(krb5_context krbctx, - krb5_data *salt) -{ - krb5_error_code kerr; - int i, v; - - /* make random salt */ - salt->length = KRB5P_SALT_SIZE; - salt->data = malloc(KRB5P_SALT_SIZE); - if (!salt->data) { - return ENOMEM; - } - kerr = krb5_c_random_make_octets(krbctx, salt); - if (kerr) { - return kerr; - } - - /* Windows treats the salt as a string. - * To avoid any compatibility issue, limits octects only to - * the ASCII printable range, or 0x20 <= val <= 0x7E */ - for (i = 0; i < salt->length; i++) { - v = (unsigned char)salt->data[i]; - v %= 0x5E; /* 7E - 20 */ - v += 0x20; /* add base */ - salt->data[i] = v; - } - - return 0; -} - static Slapi_Value **encrypt_encode_key(struct ipapwd_krbcfg *krbcfg, struct ipapwd_data *data, char **errMesg)