X-Git-Url: https://git.distorted.org.uk/u/mdw/catacomb/blobdiff_plain/a22bbdf6fa8e43546da6b4d7f6b0e014cb8deb6c..b92da8eb98f9e8ee5c86949c408c9f6e08a33c1e:/rsa-fetch.c diff --git a/rsa-fetch.c b/rsa-fetch.c index f3dcc1d..feb8e97 100644 --- a/rsa-fetch.c +++ b/rsa-fetch.c @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: rsa-fetch.c,v 1.1 2000/06/17 10:41:45 mdw Exp $ + * $Id: rsa-fetch.c,v 1.2 2000/07/01 11:19:22 mdw Exp $ * * Key fetching for RSA public and private keys * @@ -30,6 +30,9 @@ /*----- Revision history --------------------------------------------------* * * $Log: rsa-fetch.c,v $ + * Revision 1.2 2000/07/01 11:19:22 mdw + * New functions for freeing public and private keys. + * * Revision 1.1 2000/06/17 10:41:45 mdw * Table for driving key data extraction. * @@ -65,4 +68,31 @@ const key_fetchdef rsa_privfetch[] = { { 0, 0, 0, 0 } }; +/* --- @rsa_pubfree@, @rsa_privfree@ --- * + * + * Arguments: @rsa_pub *rp@, @rsa_priv *rp@ = pointer to key block + * + * Returns: --- + * + * Use: Frees an RSA key block. + */ + +void rsa_pubfree(rsa_pub *rp) +{ + mp_drop(rp->n); + mp_drop(rp->e); +} + +void rsa_privfree(rsa_priv *rp) +{ + mp_drop(rp->n); + mp_drop(rp->e); + mp_drop(rp->p); + mp_drop(rp->q); + mp_drop(rp->q_inv); + mp_drop(rp->d); + mp_drop(rp->dp); + mp_drop(rp->dq); +} + /*----- That's all, folks -------------------------------------------------*/