]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
eliminated wipemem().
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Thu, 16 Jun 2011 18:07:39 +0000 (20:07 +0200)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Thu, 16 Jun 2011 18:07:39 +0000 (20:07 +0200)
lib/opencdk/hash.c
lib/opencdk/main.h
lib/opencdk/stream.c
lib/opencdk/write-packet.c

index 349845d653eb4aa57340a3d7bcf0ae2e450b18bc..2e71c7d9d106348075a1f7f373854c6e578aaadc 100644 (file)
@@ -68,7 +68,7 @@ hash_encode (void *data, FILE * in, FILE * out)
       _gnutls_hash (&mfx->md, buf, nread);
     }
 
-  wipemem (buf, sizeof (buf));
+  memset (buf, 0, sizeof (buf));
   return 0;
 }
 
index 8b785f90a28e6f2115a8b624fe1175b540182e41..37cc64de48190c1f7f869ee5302557a53b17ab58 100644 (file)
@@ -77,17 +77,6 @@ cdk_error_t map_gnutls_error (int err);
 #define KEY_CAN_SIGN(a)    ((_cdk_pk_algo_usage ((a))) & CDK_KEY_USG_SIGN)
 #define KEY_CAN_AUTH(a)    ((_cdk_pk_algo_usage ((a))) & CDK_KEY_USG_AUTH)
 
-/* Helper macro to make sure the buffer is overwritten. */
-#define wipemem(_ptr,_len) do { \
-  volatile char *_vptr = (volatile char *)(_ptr); \
-  size_t _vlen = (_len); \
-  while (_vlen) \
-    { \
-      *_vptr = 0; \
-      _vptr++; \
-      _vlen--; \
-    } } while (0)
-
 /*-- armor.c --*/
 const char *_cdk_armor_get_lineend (void);
 
index a9e0af3a4ed8ea8e9c295e11ef5c1dbc2e362674..7e8d51e2adb725011a330333a546a02dfc65b156 100644 (file)
@@ -1376,7 +1376,7 @@ stream_cache_flush (cdk_stream_t s, FILE * fp)
         }
       s->cache.size = 0;
       s->cache.on = 0;
-      wipemem (s->cache.buf, s->cache.alloced);
+      memset (s->cache.buf, 0, s->cache.alloced);
     }
   return 0;
 }
@@ -1416,7 +1416,7 @@ cdk_stream_kick_off (cdk_stream_t inp, cdk_stream_t out)
         }
     }
 
-  wipemem (buf, sizeof (buf));
+  memset (buf, 0, sizeof (buf));
   return rc;
 }
 
index 12f432eb055fe96b9fe67c65ad110d97f5d7c1b6..e8ef87bd00616246e1a16500d45c609ce0b0600d 100644 (file)
@@ -683,7 +683,7 @@ write_literal (cdk_stream_t out, cdk_pkt_literal_t pt, int old_ctb)
         rc = stream_write (out, buf, size);
     }
 
-  wipemem (buf, sizeof (buf));
+  memset (buf, 0, sizeof (buf));
   return rc;
 }