X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=crypto%2Fhmac%2Fhm_ameth.c;h=e03f24aedab983b26fb4eb995fdf5ae511c69449;hb=1f59eb5f111149eb0cf5cdc2b378cfa0fbdfa9c3;hp=204bdb2492d0e6bef217e11e9c923f0be106a546;hpb=74633553a912519a6e73a9d830132e58f420a6c9;p=oweals%2Fopenssl.git diff --git a/crypto/hmac/hm_ameth.c b/crypto/hmac/hm_ameth.c index 204bdb2492..e03f24aeda 100644 --- a/crypto/hmac/hm_ameth.c +++ b/crypto/hmac/hm_ameth.c @@ -1,4 +1,4 @@ -/* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL +/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2007. */ /* ==================================================================== @@ -84,6 +84,19 @@ static void hmac_key_free(EVP_PKEY *pkey) } +static int hmac_pkey_ctrl(EVP_PKEY *pkey, int op, long arg1, void *arg2) + { + switch (op) + { + case ASN1_PKEY_CTRL_DEFAULT_MD_NID: + *(int *)arg2 = NID_sha1; + return 1; + + default: + return -2; + } + } + #ifdef HMAC_TEST_PRIVATE_KEY_FORMAT /* A bogus private key format for test purposes. This is simply the * HMAC key with "HMAC PRIVATE KEY" in the headers. When enabled the @@ -140,10 +153,10 @@ const EVP_PKEY_ASN1_METHOD hmac_asn1_meth = hmac_size, 0, - 0,0,0,0,0,0, + 0,0,0,0,0,0,0, hmac_key_free, - 0, + hmac_pkey_ctrl, #ifdef HMAC_TEST_PRIVATE_KEY_FORMAT old_hmac_decode, old_hmac_encode