/* Random to key */
krb5_error_code k5_rand2key_direct(const krb5_data *randombits,
krb5_keyblock *keyblock);
-krb5_error_code k5_rand2key_des(const krb5_data *randombits,
- krb5_keyblock *keyblock);
krb5_error_code k5_rand2key_des3(const krb5_data *randombits,
krb5_keyblock *keyblock);
/* Set the parity bits to the correct values in keybits. */
void k5_des_fixup_key_parity(unsigned char *keybits);
-/* Return true if keybits is a weak or semi-weak DES key. */
-krb5_boolean k5_des_is_weak_key(unsigned char *keybits);
-
/* Compute an HMAC using the provided hash function, key, and data, storing the
* result into output (caller-allocated). */
krb5_error_code krb5int_hmac(const struct krb5_hash_provider *hash,
((b[6] & 1) << 7));
}
-krb5_error_code
-k5_rand2key_des(const krb5_data *randombits, krb5_keyblock *keyblock)
-{
- if (randombits->length != 7)
- return(KRB5_CRYPTO_INTERNAL);
-
- keyblock->magic = KV5M_KEYBLOCK;
-
- /* Take the seven bytes, move them around into the top 7 bits of the
- * 8 key bytes, then compute the parity bits. */
- memcpy(keyblock->contents, randombits->data, randombits->length);
- eighth_byte(keyblock->contents);
- k5_des_fixup_key_parity(keyblock->contents);
-
- return 0;
-}
-
krb5_error_code
k5_rand2key_des3(const krb5_data *randombits, krb5_keyblock *keyblock)
{