gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r29455 - in gnunet/src: gns include namestore util


From: gnunet
Subject: [GNUnet-SVN] r29455 - in gnunet/src: gns include namestore util
Date: Sat, 21 Sep 2013 22:14:00 +0200

Author: grothoff
Date: 2013-09-21 22:14:00 +0200 (Sat, 21 Sep 2013)
New Revision: 29455

Modified:
   gnunet/src/gns/gnunet-gns-proxy.c
   gnunet/src/include/gnunet_crypto_lib.h
   gnunet/src/namestore/gnunet-namestore-fcfsd.c
   gnunet/src/namestore/gnunet-namestore.c
   gnunet/src/util/crypto_ecc.c
Log:
clear private keys in static locations on exit

Modified: gnunet/src/gns/gnunet-gns-proxy.c
===================================================================
--- gnunet/src/gns/gnunet-gns-proxy.c   2013-09-21 20:13:25 UTC (rev 29454)
+++ gnunet/src/gns/gnunet-gns-proxy.c   2013-09-21 20:14:00 UTC (rev 29455)
@@ -2855,6 +2855,7 @@
                            &run, NULL)) ? 0 : 1;
   MHD_destroy_response (curl_failure_response);
   GNUNET_free_non_null ((char *) argv);
+  GNUNET_CRYPTO_ecc_key_clear (&local_shorten_zone);
   return ret;
 }
 

Modified: gnunet/src/include/gnunet_crypto_lib.h
===================================================================
--- gnunet/src/include/gnunet_crypto_lib.h      2013-09-21 20:13:25 UTC (rev 
29454)
+++ gnunet/src/include/gnunet_crypto_lib.h      2013-09-21 20:14:00 UTC (rev 
29455)
@@ -901,6 +901,16 @@
 
 /**
  * @ingroup crypto
+ * Clear memory that was used to store a private key. 
+ *
+ * @param pk location of the key
+ */
+void
+GNUNET_CRYPTO_ecc_key_clear (struct GNUNET_CRYPTO_EccPrivateKey *pk);
+
+
+/**
+ * @ingroup crypto
  * Get the shared private key we use for anonymous users.
  *
  * @return "anonymous" private key; do not free

Modified: gnunet/src/namestore/gnunet-namestore-fcfsd.c
===================================================================
--- gnunet/src/namestore/gnunet-namestore-fcfsd.c       2013-09-21 20:13:25 UTC 
(rev 29454)
+++ gnunet/src/namestore/gnunet-namestore-fcfsd.c       2013-09-21 20:14:00 UTC 
(rev 29455)
@@ -1030,6 +1030,7 @@
                           options,
                            &run, NULL)) ? 0 : 1;
   GNUNET_free ((void*) argv);
+  GNUNET_CRYPTO_ecc_key_clear (&fcfs_zone_pkey);
   return ret;
 }
 

Modified: gnunet/src/namestore/gnunet-namestore.c
===================================================================
--- gnunet/src/namestore/gnunet-namestore.c     2013-09-21 20:13:25 UTC (rev 
29454)
+++ gnunet/src/namestore/gnunet-namestore.c     2013-09-21 20:14:00 UTC (rev 
29455)
@@ -748,9 +748,11 @@
                          &run, NULL))
   {
     GNUNET_free ((void*) argv);
+    GNUNET_CRYPTO_ecc_key_clear (&zone_pkey);
     return 1;
   }
   GNUNET_free ((void*) argv);
+  GNUNET_CRYPTO_ecc_key_clear (&zone_pkey);
   return ret;
 }
 

Modified: gnunet/src/util/crypto_ecc.c
===================================================================
--- gnunet/src/util/crypto_ecc.c        2013-09-21 20:13:25 UTC (rev 29454)
+++ gnunet/src/util/crypto_ecc.c        2013-09-21 20:14:00 UTC (rev 29455)
@@ -426,6 +426,19 @@
 
 
 /**
+ * @ingroup crypto
+ * Clear memory that was used to store a private key. 
+ *
+ * @param pk location of the key
+ */
+void
+GNUNET_CRYPTO_ecc_key_clear (struct GNUNET_CRYPTO_EccPrivateKey *pk)
+{
+  memset (pk, 0, sizeof (struct GNUNET_CRYPTO_EccPrivateKey);
+}
+
+
+/**
  * Create a new private key. Caller must free return value.
  *
  * @return fresh private key




reply via email to

[Prev in Thread] Current Thread [Next in Thread]