mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
@@ -13,7 +13,7 @@ static krb5_error_code ipa_get_random_salt(krb5_context krbctx,
|
|||||||
krb5_data *salt)
|
krb5_data *salt)
|
||||||
{
|
{
|
||||||
krb5_error_code kerr;
|
krb5_error_code kerr;
|
||||||
int i;
|
int i, v;
|
||||||
|
|
||||||
/* make random salt */
|
/* make random salt */
|
||||||
salt->length = KRB5P_SALT_SIZE;
|
salt->length = KRB5P_SALT_SIZE;
|
||||||
@@ -30,8 +30,10 @@ static krb5_error_code ipa_get_random_salt(krb5_context krbctx,
|
|||||||
* To avoid any compatibility issue, limits octects only to
|
* To avoid any compatibility issue, limits octects only to
|
||||||
* the ASCII printable range, or 0x20 <= val <= 0x7E */
|
* the ASCII printable range, or 0x20 <= val <= 0x7E */
|
||||||
for (i = 0; i < salt->length; i++) {
|
for (i = 0; i < salt->length; i++) {
|
||||||
salt->data[i] %= 0x5E; /* 7E - 20 */
|
v = (unsigned char)salt->data[i];
|
||||||
salt->data[i] += 0x20; /* add base */
|
v %= 0x5E; /* 7E - 20 */
|
||||||
|
v += 0x20; /* add base */
|
||||||
|
salt->data[i] = v;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user