X-Git-Url: https://git.distorted.org.uk/u/mdw/catacomb/blobdiff_plain/2bdb833f485d3c985a0f930865452fcaafdf95dd..5af0f9cb18436918d1660e8dd217224a8dbe7aef:/dsa-fetch.c diff --git a/dsa-fetch.c b/dsa-fetch.c index 440f80e..27c446e 100644 --- a/dsa-fetch.c +++ b/dsa-fetch.c @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: dsa-fetch.c,v 1.1 2000/06/17 10:41:45 mdw Exp $ + * $Id: dsa-fetch.c,v 1.2 2000/07/01 11:19:22 mdw Exp $ * * Key fetching for DSA public and private keys * @@ -30,6 +30,9 @@ /*----- Revision history --------------------------------------------------* * * $Log: dsa-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. * @@ -71,4 +74,38 @@ const key_fetchdef dsa_privfetch[] = { { 0, 0, 0, 0 } }; +/* --- @dsa_paramfree@, @dsa_pubfree@, @dsa_privfree@ --- * + * + * Arguments: @dsa_param *dp@, @dsa_pub *dp@, @dsa_priv *dp@ = pointer + * to key block to free + * + * Returns: --- + * + * Use: Frees a DSA key block. + */ + +void dsa_paramfree(dsa_param *dp) +{ + mp_drop(dp->p); + mp_drop(dp->q); + mp_drop(dp->g); +} + +void dsa_pubfree(dsa_pub *dp) +{ + mp_drop(dp->dp.p); + mp_drop(dp->dp.q); + mp_drop(dp->dp.g); + mp_drop(dp->y); +} + +void dsa_privfree(dsa_priv *dp) +{ + mp_drop(dp->dp.p); + mp_drop(dp->dp.q); + mp_drop(dp->dp.g); + mp_drop(dp->y); + mp_drop(dp->x); +} + /*----- That's all, folks -------------------------------------------------*/