changeset 9628:8b78449a7146

Disable secure memory in gc-libgcrypt.c.
author Simon Josefsson <simon@josefsson.org>
date Wed, 16 Jan 2008 15:53:45 +0100
parents 5d966818e300
children f0da2292f5e5
files ChangeLog lib/gc-libgcrypt.c
diffstat 2 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Jan 16 15:01:09 2008 +0100
+++ b/ChangeLog	Wed Jan 16 15:53:45 2008 +0100
@@ -1,3 +1,9 @@
+2008-01-15  Simon Josefsson  <simon@josefsson.org>
+
+	* lib/gc-libgcrypt.c (gc_init): Disable secure memory by default.
+	Applications that requires it should initialize libgcrypt
+	manually.
+
 2008-01-16  Simon Josefsson  <simon@josefsson.org>
 
 	* lib/gethostname.c [!HAVE_UNAME]: Need string.h for strcpy.
--- a/lib/gc-libgcrypt.c	Wed Jan 16 15:01:09 2008 +0100
+++ b/lib/gc-libgcrypt.c	Wed Jan 16 15:53:45 2008 +0100
@@ -1,5 +1,5 @@
 /* gc-libgcrypt.c --- Crypto wrappers around Libgcrypt for GC.
- * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007  Simon Josefsson
+ * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008  Simon Josefsson
  *
  * This file is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published
@@ -46,6 +46,9 @@
   err = gcry_control (GCRYCTL_ANY_INITIALIZATION_P);
   if (err == GPG_ERR_NO_ERROR)
     {
+      if (gcry_control (GCRYCTL_DISABLE_SECMEM, NULL, 0))
+	return GC_INIT_ERROR;
+
       if (gcry_check_version (GCRYPT_VERSION) == NULL)
 	return GC_INIT_ERROR;