summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2007-12-03 09:56:52 +0000
committerWerner Koch <wk@gnupg.org>2007-12-03 09:56:52 +0000
commit5ff275e82f980bd95edf9764193a8cdd08fe2f99 (patch)
treea7971f74b0ae87f7476fbfb1d526bd8fe6cf06ce /src
parente63c8ab3860ba635132d20a9bca54621635edb71 (diff)
downloadlibgcrypt-5ff275e82f980bd95edf9764193a8cdd08fe2f99.tar.gz
Preparing a release
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog9
-rw-r--r--src/dumpsexp.c4
-rw-r--r--src/gcrypt.h.in2
-rw-r--r--src/misc.c49
-rw-r--r--src/secmem.c3
5 files changed, 39 insertions, 28 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 7f9f4f30..0fd0dd2e 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,12 @@
+2007-12-03 Werner Koch <wk@g10code.com>
+
+ * misc.c (_gcry_logv): Use abort for error levels fatal and bug as
+ this is more approriate for a library. Terminate the secmem
+ before doing so.
+ (_gcry_fatal_error): Terminate secmem before abort.
+ * secmem.c (_gcry_secmem_malloc_internal): Use log_bug instead of
+ exit.
+
2007-11-29 Werner Koch <wk@g10code.com>
* hwfeatures.c (detect_ia32_gnuc): Detect Padlock engine.
diff --git a/src/dumpsexp.c b/src/dumpsexp.c
index b91dbb72..157c4105 100644
--- a/src/dumpsexp.c
+++ b/src/dumpsexp.c
@@ -12,9 +12,7 @@
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include <config.h>
diff --git a/src/gcrypt.h.in b/src/gcrypt.h.in
index 1989e3ec..eeb5e4b2 100644
--- a/src/gcrypt.h.in
+++ b/src/gcrypt.h.in
@@ -1609,7 +1609,7 @@ void gcry_randomize (void *buffer, size_t length,
pool. QUALITY should either be -1 for unknown or in the range of 0
to 100 */
gcry_error_t gcry_random_add_bytes (const void *buffer, size_t length,
- int quality);
+ int quality);
/* If random numbers are used in an application, this macro should be
called from time to time so that new stuff gets added to the
diff --git a/src/misc.c b/src/misc.c
index 30fedd6c..15dc3649 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -1,10 +1,10 @@
/* misc.c
- * Copyright (C) 1999, 2001, 2002, 2003 Free Software Foundation, Inc.
+ * Copyright (C) 1999, 2001, 2002, 2003, 2007 Free Software Foundation, Inc.
*
* This file is part of Libgcrypt.
*
* Libgcrypt is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser general Public License as
+ * it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
@@ -14,8 +14,7 @@
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * License along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include <config.h>
@@ -26,6 +25,7 @@
#include <unistd.h>
#include "g10lib.h"
+#include "secmem.h"
static int verbosity_level = 0;
@@ -81,6 +81,7 @@ _gcry_fatal_error (int rc, const char *text)
write2stderr("\nFatal error: ");
write2stderr(text);
write2stderr("\n");
+ _gcry_secmem_term ();
abort ();
}
@@ -111,28 +112,32 @@ _gcry_log_verbosity( int level )
static void
_gcry_logv( int level, const char *fmt, va_list arg_ptr )
{
- if( log_handler )
- log_handler( log_handler_value, level, fmt, arg_ptr );
- else {
- switch ( level ) {
- case GCRY_LOG_CONT: break;
- case GCRY_LOG_INFO: break;
- case GCRY_LOG_WARN: break;
- case GCRY_LOG_ERROR: break;
- case GCRY_LOG_FATAL: fputs("Fatal: ",stderr ); break;
- case GCRY_LOG_BUG: fputs("Ohhhh jeeee: ", stderr); break;
- case GCRY_LOG_DEBUG: fputs("DBG: ", stderr ); break;
- default: fprintf(stderr,"[Unknown log level %d]: ", level ); break;
+ if (log_handler)
+ log_handler (log_handler_value, level, fmt, arg_ptr);
+ else
+ {
+ switch (level)
+ {
+ case GCRY_LOG_CONT: break;
+ case GCRY_LOG_INFO: break;
+ case GCRY_LOG_WARN: break;
+ case GCRY_LOG_ERROR: break;
+ case GCRY_LOG_FATAL: fputs("Fatal: ",stderr ); break;
+ case GCRY_LOG_BUG: fputs("Ohhhh jeeee: ", stderr); break;
+ case GCRY_LOG_DEBUG: fputs("DBG: ", stderr ); break;
+ default: fprintf(stderr,"[Unknown log level %d]: ", level ); break;
}
- vfprintf(stderr,fmt,arg_ptr) ;
+ vfprintf(stderr,fmt,arg_ptr) ;
+ }
+
+ if ( level == GCRY_LOG_FATAL || level == GCRY_LOG_BUG )
+ {
+ _gcry_secmem_term ();
+ abort ();
}
-
- if( level == GCRY_LOG_FATAL )
- exit(2);
- else if( level == GCRY_LOG_BUG )
- abort();
}
+
void
_gcry_log( int level, const char *fmt, ... )
{
diff --git a/src/secmem.c b/src/secmem.c
index 2d603a2a..1bcfa044 100644
--- a/src/secmem.c
+++ b/src/secmem.c
@@ -494,9 +494,8 @@ _gcry_secmem_malloc_internal (size_t size)
if (!pool_okay)
{
- log_info (_
+ log_bug (_
("operation is not possible without initialized secure memory\n"));
- exit (2);
}
if (show_warning && !suspend_warning)
{