From: Dr. Stephen Henson Date: Tue, 1 Jul 2014 11:01:00 +0000 (+0100) Subject: Accessor functions for app_data in ECDSA_METHOD X-Git-Tag: OpenSSL_1_0_2-beta2~63 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=654ae3d6ad61367060ffc20db11c7cf86b8f95b8;p=openssl Accessor functions for app_data in ECDSA_METHOD (cherry picked from commit 387b844ffdc79b733be0b1dbaddd2ac64a6c1192) --- diff --git a/crypto/ecdsa/ecdsa.h b/crypto/ecdsa/ecdsa.h index 418b218d12..55f959cd3d 100644 --- a/crypto/ecdsa/ecdsa.h +++ b/crypto/ecdsa/ecdsa.h @@ -241,6 +241,21 @@ ECDSA_METHOD *ECDSA_METHOD_new(ECDSA_METHOD *ecdsa_method); */ void ECDSA_METHOD_free(ECDSA_METHOD *ecdsa_method); +/** Sets application specific data in the ECDSA_METHOD + * \param ecdsa_method pointer to existing ECDSA_METHOD + * \param app application specific data to set + */ + +void ECDSA_METHOD_set_app_data(ECDSA_METHOD *ecdsa_method, void *app); + +/** Returns application specific data from a ECDSA_METHOD structure + * \param ecdsa_method pointer to ECDSA_METHOD structure + * \return pointer to application specific data. + */ + + +void * ECDSA_METHOD_get_app_data(ECDSA_METHOD *ecdsa_method); + /** Set the ECDSA_do_sign function in the ECDSA_METHOD * \param ecdsa_method pointer to existing ECDSA_METHOD * \param ecdsa_do_sign a funtion of type ECDSA_do_sign diff --git a/crypto/ecdsa/ecs_lib.c b/crypto/ecdsa/ecs_lib.c index 0d79469201..071349e314 100644 --- a/crypto/ecdsa/ecs_lib.c +++ b/crypto/ecdsa/ecs_lib.c @@ -347,4 +347,12 @@ void ECDSA_METHOD_free(ECDSA_METHOD *ecdsa_method) OPENSSL_free(ecdsa_method); } +void ECDSA_METHOD_set_app_data(ECDSA_METHOD *ecdsa_method, void *app) + { + ecdsa_method->app_data = app; + } +void * ECDSA_METHOD_get_app_data(ECDSA_METHOD *ecdsa_method) + { + return ecdsa_method->app_data; + } diff --git a/crypto/ecdsa/ecs_locl.h b/crypto/ecdsa/ecs_locl.h index 810def12e8..d03f53217a 100644 --- a/crypto/ecdsa/ecs_locl.h +++ b/crypto/ecdsa/ecs_locl.h @@ -79,7 +79,7 @@ struct ecdsa_method int (*finish)(EC_KEY *eckey); #endif int flags; - char *app_data; + void *app_data; }; /* The ECDSA_METHOD was allocated and can be freed */