goto cleanup;
}
+ /* The test vectors in RFC 8636 implicitly use NT-PRINCIPAL names. */
+ u_principal->type = KRB5_NT_PRINCIPAL;
+ v_principal->type = KRB5_NT_PRINCIPAL;
+
/* set-up the as_req and and pk_as_rep data */
memset(twenty_as, 0xaa, sizeof(twenty_as));
memset(eighteen_bs, 0xbb, sizeof(eighteen_bs));
/* TEST 1: SHA-1/AES */
/* set up algorithm id */
- alg_id.algorithm.data = (char *)krb5_pkinit_sha1_oid;
- alg_id.algorithm.length = krb5_pkinit_sha1_oid_len;
+ alg_id.algorithm = sha1_id;
enctype = enctype_aes;
u_principal, v_principal,
enctype, &as_req, &pk_as_rep,
&key_block))) {
- printf("ERROR in pkinit_kdf_test: kdf call failed, retval = %d",
+ printf("ERROR in pkinit_kdf_test: kdf call failed, retval = %d\n",
retval);
goto cleanup;
}
/* TEST 2: SHA-256/AES */
/* set up algorithm id */
- alg_id.algorithm.data = (char *)krb5_pkinit_sha256_oid;
- alg_id.algorithm.length = krb5_pkinit_sha256_oid_len;
+ alg_id.algorithm = sha256_id;
enctype = enctype_aes;
u_principal, v_principal,
enctype, &as_req, &pk_as_rep,
&key_block))) {
- printf("ERROR in pkinit_kdf_test: kdf call failed, retval = %d",
+ printf("ERROR in pkinit_kdf_test: kdf call failed, retval = %d\n",
retval);
goto cleanup;
}
/* TEST 3: SHA-512/DES3 */
/* set up algorithm id */
- alg_id.algorithm.data = (char *)krb5_pkinit_sha512_oid;
- alg_id.algorithm.length = krb5_pkinit_sha512_oid_len;
+ alg_id.algorithm = sha512_id;
enctype = enctype_des3;
u_principal, v_principal,
enctype, &as_req, &pk_as_rep,
&key_block))) {
- printf("ERROR in pkinit_kdf_test: kdf call failed, retval = %d",
+ printf("ERROR in pkinit_kdf_test: kdf call failed, retval = %d\n",
retval);
goto cleanup;
}
krb5_free_principal(context, u_principal);
krb5_free_principal(context, v_principal);
krb5_free_keyblock_contents(context, &key_block);
- exit(retval);
+ krb5_free_context(context);
+ return retval ? 1 : 0;
}