From: Sergey Agievich Date: Mon, 1 Jun 2015 11:48:27 +0000 (+0100) Subject: Add funtions to set item_sign and item_verify X-Git-Tag: OpenSSL_1_0_2b~35 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=ad0fb7f4988c8a717fe6bcb035304385fbdaef41;p=oweals%2Fopenssl.git Add funtions to set item_sign and item_verify PR#3872 Reviewed-by: Matt Caswell Reviewed-by: Stephen Henson --- diff --git a/crypto/asn1/ameth_lib.c b/crypto/asn1/ameth_lib.c index 02300dfedf..5389c04347 100644 --- a/crypto/asn1/ameth_lib.c +++ b/crypto/asn1/ameth_lib.c @@ -464,3 +464,21 @@ void EVP_PKEY_asn1_set_ctrl(EVP_PKEY_ASN1_METHOD *ameth, { ameth->pkey_ctrl = pkey_ctrl; } + +void EVP_PKEY_asn1_set_item(EVP_PKEY_ASN1_METHOD *ameth, + int (*item_verify) (EVP_MD_CTX *ctx, + const ASN1_ITEM *it, + void *asn, + X509_ALGOR *a, + ASN1_BIT_STRING *sig, + EVP_PKEY *pkey), + int (*item_sign) (EVP_MD_CTX *ctx, + const ASN1_ITEM *it, + void *asn, + X509_ALGOR *alg1, + X509_ALGOR *alg2, + ASN1_BIT_STRING *sig)) +{ + ameth->item_sign = item_sign; + ameth->item_verify = item_verify; +} diff --git a/crypto/evp/evp.h b/crypto/evp/evp.h index 1d705cd5de..39ab7937d2 100644 --- a/crypto/evp/evp.h +++ b/crypto/evp/evp.h @@ -1123,6 +1123,19 @@ void EVP_PKEY_asn1_set_free(EVP_PKEY_ASN1_METHOD *ameth, void EVP_PKEY_asn1_set_ctrl(EVP_PKEY_ASN1_METHOD *ameth, int (*pkey_ctrl) (EVP_PKEY *pkey, int op, long arg1, void *arg2)); +void EVP_PKEY_asn1_set_item(EVP_PKEY_ASN1_METHOD *ameth, + int (*item_verify) (EVP_MD_CTX *ctx, + const ASN1_ITEM *it, + void *asn, + X509_ALGOR *a, + ASN1_BIT_STRING *sig, + EVP_PKEY *pkey), + int (*item_sign) (EVP_MD_CTX *ctx, + const ASN1_ITEM *it, + void *asn, + X509_ALGOR *alg1, + X509_ALGOR *alg2, + ASN1_BIT_STRING *sig)); # define EVP_PKEY_OP_UNDEFINED 0 # define EVP_PKEY_OP_PARAMGEN (1<<1)