krb5: implement draft-ietf-kitten-aes-cts-hmac-sha2-07

This commit is contained in:
Luke Howard
2015-11-27 18:55:30 +11:00
parent a3bece16c7
commit 7b720cf61c
32 changed files with 1662 additions and 382 deletions

View File

@@ -107,24 +107,24 @@ test_pkcs5_pbe2(const struct tests *t)
unsigned char key[32];
int ret, error = 0;
ret = PKCS5_PBKDF2_HMAC_SHA1(t->password, strlen(t->password),
t->salt, strlen(t->salt),
t->iterations,
16, key);
ret = PKCS5_PBKDF2_HMAC(t->password, strlen(t->password),
t->salt, strlen(t->salt),
t->iterations, EVP_sha1(),
16, key);
if (ret != 1)
errx(1, "PKCS5_PBKDF2_HMAC_SHA1: %d", ret);
errx(1, "PKCS5_PBKDF2_HMAC: %d", ret);
if (memcmp(t->pbkdf2_128, key, 16) != 0) {
printf("incorrect 128 key\n");
error++;
}
ret = PKCS5_PBKDF2_HMAC_SHA1(t->password, strlen(t->password),
t->salt, strlen(t->salt),
t->iterations,
32, key);
ret = PKCS5_PBKDF2_HMAC(t->password, strlen(t->password),
t->salt, strlen(t->salt),
t->iterations, EVP_sha1(),
32, key);
if (ret != 1)
errx(1, "PKCS5_PBKDF2_HMAC_SHA1: %d", ret);
errx(1, "PKCS5_PBKDF2_HMAC: %d", ret);
if (memcmp(t->pbkdf2_256, key, 32) != 0) {
printf("incorrect 256 key\n");