+++ /dev/null
-/* -*-c-*-
- *
- * $Id: dsa-fetch.c,v 1.2 2000/07/01 11:19:22 mdw Exp $
- *
- * Key fetching for DSA public and private keys
- *
- * (c) 2000 Straylight/Edgeware
- */
-
-/*----- Licensing notice --------------------------------------------------*
- *
- * This file is part of Catacomb.
- *
- * Catacomb is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Library General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * Catacomb is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with Catacomb; if not, write to the Free
- * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
- * MA 02111-1307, USA.
- */
-
-/*----- 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.
- *
- */
-
-/*----- Header files ------------------------------------------------------*/
-
-#include "dsa.h"
-#include "key.h"
-
-/*----- Key fetching ------------------------------------------------------*/
-
-const key_fetchdef dsa_paramfetch[] = {
- { "p", offsetof(dsa_param, p), KENC_MP, 0 },
- { "q", offsetof(dsa_param, q), KENC_MP, 0 },
- { "g", offsetof(dsa_param, g), KENC_MP, 0 },
- { 0, 0, 0, 0 }
-};
-
-const key_fetchdef dsa_pubfetch[] = {
- { "p", offsetof(dsa_pub, dp.p), KENC_MP, 0 },
- { "q", offsetof(dsa_pub, dp.q), KENC_MP, 0 },
- { "g", offsetof(dsa_pub, dp.g), KENC_MP, 0 },
- { "y", offsetof(dsa_pub, y), KENC_MP, 0 },
- { 0, 0, 0, 0 }
-};
-
-static const key_fetchdef priv[] = {
- { "x", offsetof(dsa_priv, x), KENC_MP, 0 },
- { 0, 0, 0, 0 }
-};
-
-const key_fetchdef dsa_privfetch[] = {
- { "p", offsetof(dsa_priv, dp.p), KENC_MP, 0 },
- { "q", offsetof(dsa_priv, dp.q), KENC_MP, 0 },
- { "g", offsetof(dsa_priv, dp.g), KENC_MP, 0 },
- { "y", offsetof(dsa_priv, y), KENC_MP, 0 },
- { "private", 0, KENC_STRUCT, priv },
- { 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 -------------------------------------------------*/