Changeset View
Changeset View
Standalone View
Standalone View
head/sys/kgssapi/krb5/kcrypto_des.c
Show First 20 Lines • Show All 129 Lines • ▼ Show 20 Lines | des1_random_to_key(struct krb5_key_state *ks, const void *in) | ||||
outkey[6] = inkey[6]; | outkey[6] = inkey[6]; | ||||
outkey[7] = (((inkey[0] & 1) << 1) | outkey[7] = (((inkey[0] & 1) << 1) | ||||
| ((inkey[1] & 1) << 2) | | ((inkey[1] & 1) << 2) | ||||
| ((inkey[2] & 1) << 3) | | ((inkey[2] & 1) << 3) | ||||
| ((inkey[3] & 1) << 4) | | ((inkey[3] & 1) << 4) | ||||
| ((inkey[4] & 1) << 5) | | ((inkey[4] & 1) << 5) | ||||
| ((inkey[5] & 1) << 6) | | ((inkey[5] & 1) << 6) | ||||
| ((inkey[6] & 1) << 7)); | | ((inkey[6] & 1) << 7)); | ||||
des_set_odd_parity((des_cblock *) outkey); | des_set_odd_parity(outkey); | ||||
if (des_is_weak_key((des_cblock *) outkey)) | if (des_is_weak_key(outkey)) | ||||
outkey[7] ^= 0xf0; | outkey[7] ^= 0xf0; | ||||
des1_set_key(ks, ks->ks_key); | des1_set_key(ks, ks->ks_key); | ||||
} | } | ||||
static int | static int | ||||
des1_crypto_cb(struct cryptop *crp) | des1_crypto_cb(struct cryptop *crp) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 120 Lines • Show Last 20 Lines |