}
static void enc()
{
- krb5int_aes_encrypt(&enc_key, &ivec, &in, &out);
+ krb5_key key;
+
+ krb5_k_create_key(NULL, &enc_key, &key);
+ krb5int_aes_encrypt(key, &ivec, &in, &out);
+ krb5_k_free_key(NULL, key);
}
static void hexdump(const char *label, const char *cp, int len)
krb5_boolean valid;
size_t length;
krb5_keyblock keyblock;
+ krb5_key key;
krb5_error_code kret=0;
krb5_data plaintext, newstyle_checksum;
keyblock.length = sizeof(testkey);
keyblock.contents = testkey;
+ krb5_k_create_key(NULL, &keyblock, &key);
+
length = khp.hashsize;
newstyle_checksum.length = length;
plaintext.length = strlen(argv[msgindex]);
plaintext.data = argv[msgindex];
- if ((kret = (*(khp.hash))(&keyblock, 0, 0, &plaintext, &newstyle_checksum))) {
+ if ((kret = (*(khp.hash))(key, 0, 0, &plaintext, &newstyle_checksum))) {
printf("krb5_calculate_checksum choked with %d\n", kret);
break;
}
print_checksum("correct", MD, argv[msgindex], &newstyle_checksum);
- if ((kret = (*(khp.verify))(&keyblock, 0, 0, &plaintext, &newstyle_checksum,
+ if ((kret = (*(khp.verify))(key, 0, 0, &plaintext, &newstyle_checksum,
&valid))) {
printf("verify on new checksum choked with %d\n", kret);
break;
printf("Verify succeeded for \"%s\"\n", argv[msgindex]);
newstyle_checksum.data[0]++;
- if ((kret = (*(khp.verify))(&keyblock, 0, 0, &plaintext, &newstyle_checksum,
+ if ((kret = (*(khp.verify))(key, 0, 0, &plaintext, &newstyle_checksum,
&valid))) {
printf("verify on new checksum choked with %d\n", kret);
break;
char tmp[40];
size_t blocksize, hashsize;
krb5_error_code err;
+ krb5_key k;
printk(" test key", key);
blocksize = h->blocksize;
printk(" pre-hashed key", key);
}
printd(" hmac input", in);
- err = krb5_hmac(h, key, 1, in, out);
+ krb5_k_create_key(NULL, key, &k);
+ err = krb5_hmac(h, k, 1, in, out);
+ krb5_k_free_key(NULL, k);
if (err == 0)
printd(" hmac output", out);
return err;