Skip to content

Commit

Permalink
Accessor functions for app_data in ECDSA_METHOD
Browse files Browse the repository at this point in the history
  • Loading branch information
snhenson committed Jul 1, 2014
1 parent 0d263d2 commit 387b844
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
15 changes: 15 additions & 0 deletions crypto/ecdsa/ecdsa.h
Expand Up @@ -256,6 +256,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
Expand Down
8 changes: 8 additions & 0 deletions crypto/ecdsa/ecs_lib.c
Expand Up @@ -328,4 +328,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;
}
2 changes: 1 addition & 1 deletion crypto/ecdsa/ecs_locl.h
Expand Up @@ -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 */
Expand Down

0 comments on commit 387b844

Please sign in to comment.