[svn] gcry - r1187 - in branches/LIBGCRYPT-1-2-BRANCH: . cipher mpi
src
svn author wk
cvs at cvs.gnupg.org
Thu Oct 19 12:38:32 CEST 2006
Author: wk
Date: 2006-10-19 12:38:30 +0200 (Thu, 19 Oct 2006)
New Revision: 1187
Modified:
branches/LIBGCRYPT-1-2-BRANCH/NEWS
branches/LIBGCRYPT-1-2-BRANCH/TODO
branches/LIBGCRYPT-1-2-BRANCH/cipher/ChangeLog
branches/LIBGCRYPT-1-2-BRANCH/cipher/pubkey.c
branches/LIBGCRYPT-1-2-BRANCH/cipher/rndw32.c
branches/LIBGCRYPT-1-2-BRANCH/mpi/ChangeLog
branches/LIBGCRYPT-1-2-BRANCH/mpi/mpi-pow.c
branches/LIBGCRYPT-1-2-BRANCH/mpi/mpiutil.c
branches/LIBGCRYPT-1-2-BRANCH/src/ChangeLog
branches/LIBGCRYPT-1-2-BRANCH/src/global.c
branches/LIBGCRYPT-1-2-BRANCH/src/secmem.c
branches/LIBGCRYPT-1-2-BRANCH/src/secmem.h
Log:
Various minor fixes.
Modified: branches/LIBGCRYPT-1-2-BRANCH/NEWS
===================================================================
--- branches/LIBGCRYPT-1-2-BRANCH/NEWS 2006-10-19 10:34:46 UTC (rev 1186)
+++ branches/LIBGCRYPT-1-2-BRANCH/NEWS 2006-10-19 10:38:30 UTC (rev 1187)
@@ -1,7 +1,9 @@
Noteworthy changes in version 1.2.4
------------------------------------------------
+ * Minor bug fixes.
+
Noteworthy changes in version 1.2.3 (2006-08-28)
------------------------------------------------
Modified: branches/LIBGCRYPT-1-2-BRANCH/TODO
===================================================================
--- branches/LIBGCRYPT-1-2-BRANCH/TODO 2006-10-19 10:34:46 UTC (rev 1186)
+++ branches/LIBGCRYPT-1-2-BRANCH/TODO 2006-10-19 10:38:30 UTC (rev 1187)
@@ -35,3 +35,6 @@
Don't rely on the secure memory based wiping function but add an
extra wiping.
+* We need to figure out at comile time whether socklen_t is defined.
+ On IRIX 6.5 it seems not to be defined and thus gcrypt.h fails.
+
Modified: branches/LIBGCRYPT-1-2-BRANCH/cipher/ChangeLog
===================================================================
--- branches/LIBGCRYPT-1-2-BRANCH/cipher/ChangeLog 2006-10-19 10:34:46 UTC (rev 1186)
+++ branches/LIBGCRYPT-1-2-BRANCH/cipher/ChangeLog 2006-10-19 10:38:30 UTC (rev 1187)
@@ -1,3 +1,14 @@
+2006-09-11 Werner Koch <wk at g10code.com>
+
+ * rndw32.c (slow_gatherer_windowsNT): While adding data use the
+ size of the diskPerformance and not its address. Has been fixed in
+ GnuPG more than a year ago. Noted by Lee Fisher.
+
+2006-08-30 Werner Koch <wk at g10code.com>
+
+ * pubkey.c (sexp_data_to_mpi): Need to allow "ripemd160" here as
+ this is the canonical name.
+
2006-07-26 Werner Koch <wk at g10code.com>
* random.c (gcry_create_nonce): Update the pid after a fork.
Modified: branches/LIBGCRYPT-1-2-BRANCH/cipher/pubkey.c
===================================================================
--- branches/LIBGCRYPT-1-2-BRANCH/cipher/pubkey.c 2006-10-19 10:34:46 UTC (rev 1186)
+++ branches/LIBGCRYPT-1-2-BRANCH/cipher/pubkey.c 2006-10-19 10:38:30 UTC (rev 1187)
@@ -1244,8 +1244,9 @@
static struct { const char *name; int algo; } hashnames[] =
{ { "sha1", GCRY_MD_SHA1 },
{ "md5", GCRY_MD_MD5 },
+ { "sha256", GCRY_MD_SHA256 },
+ { "ripemd160", GCRY_MD_RMD160 },
{ "rmd160", GCRY_MD_RMD160 },
- { "sha256", GCRY_MD_SHA256 },
{ "sha384", GCRY_MD_SHA384 },
{ "sha512", GCRY_MD_SHA512 },
{ "md2", GCRY_MD_MD2 },
Modified: branches/LIBGCRYPT-1-2-BRANCH/cipher/rndw32.c
===================================================================
--- branches/LIBGCRYPT-1-2-BRANCH/cipher/rndw32.c 2006-10-19 10:34:46 UTC (rev 1186)
+++ branches/LIBGCRYPT-1-2-BRANCH/cipher/rndw32.c 2006-10-19 10:38:30 UTC (rev 1187)
@@ -398,7 +398,7 @@
/* Note: This only works if you have turned on the disk performance
* counters with 'diskperf -y'. These counters are off by default */
if (DeviceIoControl (hDevice, IOCTL_DISK_PERFORMANCE, NULL, 0,
- &diskPerformance, SIZEOF_DISK_PERFORMANCE_STRUCT,
+ diskPerformance, SIZEOF_DISK_PERFORMANCE_STRUCT,
&dwSize, NULL))
{
if ( debug_me )
Modified: branches/LIBGCRYPT-1-2-BRANCH/mpi/ChangeLog
===================================================================
--- branches/LIBGCRYPT-1-2-BRANCH/mpi/ChangeLog 2006-10-19 10:34:46 UTC (rev 1186)
+++ branches/LIBGCRYPT-1-2-BRANCH/mpi/ChangeLog 2006-10-19 10:38:30 UTC (rev 1187)
@@ -1,3 +1,10 @@
+2006-08-29 Werner Koch <wk at g10code.com>
+
+ * mpiutil.c (gcry_mpi_get_flag): Let it return a value to silent
+ MIPSpro cc warning.
+
+ * mpi-pow.c (gcry_mpi_powm): Removed unused variable ESIGN.
+
2006-08-28 Werner Koch <wk at g10code.com>
* mpiutil.c (_gcry_mpi_resize): Clear the new part of the resized
Modified: branches/LIBGCRYPT-1-2-BRANCH/mpi/mpi-pow.c
===================================================================
--- branches/LIBGCRYPT-1-2-BRANCH/mpi/mpi-pow.c 2006-10-19 10:34:46 UTC (rev 1186)
+++ branches/LIBGCRYPT-1-2-BRANCH/mpi/mpi-pow.c 2006-10-19 10:38:30 UTC (rev 1187)
@@ -1,5 +1,6 @@
/* mpi-pow.c - MPI functions
- * Copyright (C) 1994, 1996, 1998, 2000, 2002, 2003 Free Software Foundation, Inc.
+ * Copyright (C) 1994, 1996, 1998, 2000, 2002,
+ * 2003 Free Software Foundation, Inc.
*
* This file is part of Libgcrypt.
*
@@ -41,7 +42,7 @@
{
mpi_ptr_t rp, ep, mp, bp;
mpi_size_t esize, msize, bsize, rsize;
- int esign, msign, bsign, rsign;
+ int msign, bsign, rsign;
int esec, msec, bsec, rsec;
mpi_size_t size;
int mod_shift_cnt;
@@ -58,7 +59,6 @@
esize = expo->nlimbs;
msize = mod->nlimbs;
size = 2 * msize;
- esign = expo->sign;
msign = mod->sign;
esec = mpi_is_secure(expo);
Modified: branches/LIBGCRYPT-1-2-BRANCH/mpi/mpiutil.c
===================================================================
--- branches/LIBGCRYPT-1-2-BRANCH/mpi/mpiutil.c 2006-10-19 10:34:46 UTC (rev 1186)
+++ branches/LIBGCRYPT-1-2-BRANCH/mpi/mpiutil.c 2006-10-19 10:38:30 UTC (rev 1187)
@@ -436,5 +436,7 @@
case GCRYMPI_FLAG_OPAQUE: return (a->flags & 4);
default: log_bug("invalid flag value\n");
}
+ /*NOTREACHED*/
+ return 0;
}
Modified: branches/LIBGCRYPT-1-2-BRANCH/src/ChangeLog
===================================================================
--- branches/LIBGCRYPT-1-2-BRANCH/src/ChangeLog 2006-10-19 10:34:46 UTC (rev 1186)
+++ branches/LIBGCRYPT-1-2-BRANCH/src/ChangeLog 2006-10-19 10:38:30 UTC (rev 1187)
@@ -1,3 +1,16 @@
+2006-10-19 Werner Koch <wk at g10code.com>
+
+ * global.c (gcry_control) <GCRYCTL_INIT_SECMEM>: Return an error
+ if the memory could not be locked.
+ * secmem.c (not_locked): New.
+ (_gcry_secmem_get_flags): Return that flag.
+ * secmem.h (GCRY_SECMEM_FLAG_NOT_LOCKED): New.
+
+2006-08-29 Werner Koch <wk at g10code.com>
+
+ * global.c (gcry_xrealloc): Set secure flag when calling out of
+ core handler.
+
2006-08-28 Werner Koch <wk at g10code.com>
* global.c (gcry_control): Clandestine API change for
Modified: branches/LIBGCRYPT-1-2-BRANCH/src/global.c
===================================================================
--- branches/LIBGCRYPT-1-2-BRANCH/src/global.c 2006-10-19 10:34:46 UTC (rev 1186)
+++ branches/LIBGCRYPT-1-2-BRANCH/src/global.c 2006-10-19 10:38:30 UTC (rev 1187)
@@ -209,6 +209,8 @@
case GCRYCTL_INIT_SECMEM:
global_init ();
_gcry_secmem_init (va_arg (arg_ptr, unsigned int));
+ if ((_gcry_secmem_get_flags () & GCRY_SECMEM_FLAG_NOT_LOCKED))
+ err = GPG_ERR_GENERAL;
break;
case GCRYCTL_TERM_SECMEM:
@@ -587,7 +589,8 @@
while ( !(p = gcry_realloc( a, n )) ) {
if( !outofcore_handler
- || !outofcore_handler( outofcore_handler_value, n, 2 ) ) {
+ || !outofcore_handler( outofcore_handler_value, n,
+ gcry_is_secure(a)? 3:2 ) ) {
_gcry_fatal_error(gpg_err_code_from_errno (errno), NULL );
}
}
Modified: branches/LIBGCRYPT-1-2-BRANCH/src/secmem.c
===================================================================
--- branches/LIBGCRYPT-1-2-BRANCH/src/secmem.c 2006-10-19 10:34:46 UTC (rev 1186)
+++ branches/LIBGCRYPT-1-2-BRANCH/src/secmem.c 2006-10-19 10:38:30 UTC (rev 1187)
@@ -75,6 +75,7 @@
/* FIXME? */
static int disable_secmem;
static int show_warning;
+static int not_locked;
static int no_warning;
static int suspend_warning;
@@ -246,6 +247,7 @@
)
log_error ("can't lock memory: %s\n", strerror (err));
show_warning = 1;
+ not_locked = 1;
}
#elif defined(HAVE_MLOCK)
@@ -299,6 +301,7 @@
)
log_error ("can't lock memory: %s\n", strerror (err));
show_warning = 1;
+ not_locked = 1;
}
#elif defined ( __QNX__ )
@@ -407,7 +410,7 @@
SECMEM_UNLOCK;
}
-unsigned
+unsigned int
_gcry_secmem_get_flags (void)
{
unsigned flags;
@@ -416,6 +419,7 @@
flags = no_warning ? GCRY_SECMEM_FLAG_NO_WARNING : 0;
flags |= suspend_warning ? GCRY_SECMEM_FLAG_SUSPEND_WARNING : 0;
+ flags |= not_locked ? GCRY_SECMEM_FLAG_NOT_LOCKED : 0;
SECMEM_UNLOCK;
@@ -619,6 +623,7 @@
pool = NULL;
pool_okay = 0;
pool_size = 0;
+ not_locked = 0;
}
Modified: branches/LIBGCRYPT-1-2-BRANCH/src/secmem.h
===================================================================
--- branches/LIBGCRYPT-1-2-BRANCH/src/secmem.h 2006-10-19 10:34:46 UTC (rev 1186)
+++ branches/LIBGCRYPT-1-2-BRANCH/src/secmem.h 2006-10-19 10:38:30 UTC (rev 1187)
@@ -32,7 +32,8 @@
int _gcry_private_is_secure (const void *p) GCC_ATTR_PURE;
/* Flags for _gcry_secmem_{set,get}_flags. */
-#define GCRY_SECMEM_FLAG_NO_WARNING 1 << 0
-#define GCRY_SECMEM_FLAG_SUSPEND_WARNING 1 << 1
+#define GCRY_SECMEM_FLAG_NO_WARNING (1 << 0)
+#define GCRY_SECMEM_FLAG_SUSPEND_WARNING (1 << 1)
+#define GCRY_SECMEM_FLAG_NOT_LOCKED (1 << 2)
#endif /* G10_SECMEM_H */
More information about the Gnupg-commits
mailing list