summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2006-10-17 17:44:49 +0000
committerWerner Koch <wk@gnupg.org>2006-10-17 17:44:49 +0000
commit7b99fd7c97e11524f8eb1c9b158cf791f5a44caf (patch)
tree2a299b9249ee68c71ada82852da79d730aed5c0c /src
parent488b253f39b008230989660639304f66f1015626 (diff)
downloadlibgcrypt-7b99fd7c97e11524f8eb1c9b158cf791f5a44caf.tar.gz
Various minor changes.
Support for DSA2.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog14
-rw-r--r--src/cipher.h6
-rw-r--r--src/global.c3
-rw-r--r--src/libgcrypt.m42
-rw-r--r--src/module.c23
-rw-r--r--src/sexp.c4
6 files changed, 43 insertions, 9 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 7fa1e832..2ff7e9be 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,11 @@
+2006-10-05 Werner Koch <wk@g10code.com>
+
+ * module.c (_gcry_module_id_new): Don't assign modules in the range
+ the range of 1024..4096.
+ * gcrypt.h (GCRY_MD_USER, GCRY_MD_USER_LAST): New
+ (GCRY_PK_USER, GCRY_PK_USER_LAST): New.
+ (GCRY_CIPHER_USER, GCRY_CIPHER_USER_LAST): New.
+
2006-10-12 Marcus Brinkmann <marcus@g10code.de>
* gcrypt.h.in: Replace socklen_t with gcry_socklen_t.
@@ -12,8 +20,14 @@
* gcrypt.h.in: ... this file.
* Makefile.am (EXTRA_DIST): Add gcrypt.h.in.
+2006-09-04 Werner Koch <wk@g10code.com>
+
+ * gcrypt.h: Removed some trailing comma in enums.
+
2006-08-29 Werner Koch <wk@g10code.com>
+ * global.c (gcry_xrealloc): Pass secure flag to outofcore handler.
+
* gcrypt.h (GCRY_CIPHER_SEED): New.
2006-08-21 Werner Koch <wk@g10code.com>
diff --git a/src/cipher.h b/src/cipher.h
index 7af8f38f..bdf8c803 100644
--- a/src/cipher.h
+++ b/src/cipher.h
@@ -35,6 +35,12 @@ void _gcry_sha1_hash_buffer (char *outbuf, const char *buffer, size_t length);
/*-- dsa.c --*/
void _gcry_register_pk_dsa_progress (gcry_handler_progress_t cbc, void *cb_data);
+gcry_err_code_t _gcry_dsa_generate2 (int algo, unsigned int nbits,
+ unsigned int qbits,
+ unsigned long dummy,
+ gcry_mpi_t *skey,
+ gcry_mpi_t **retfactors);
+
/*-- elgamal.c --*/
void _gcry_register_pk_elg_progress (gcry_handler_progress_t cb, void *cb_data);
/*-- primegen.c --*/
diff --git a/src/global.c b/src/global.c
index 46a12be7..d62c5be1 100644
--- a/src/global.c
+++ b/src/global.c
@@ -644,7 +644,8 @@ gcry_xrealloc( void *a, size_t n )
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 );
}
}
diff --git a/src/libgcrypt.m4 b/src/libgcrypt.m4
index 20bd1055..c5e86316 100644
--- a/src/libgcrypt.m4
+++ b/src/libgcrypt.m4
@@ -89,7 +89,7 @@ AC_DEFUN([AM_PATH_LIBGCRYPT],
AC_MSG_RESULT(okay)
else
ok=no
- AC_MSG_RESULT([does not match (want=$req_libgcrypt_api got=$tmp)])
+ AC_MSG_RESULT([does not match. want=$req_libgcrypt_api got=$tmp])
fi
fi
fi
diff --git a/src/module.c b/src/module.c
index 69a79306..d99fbcfd 100644
--- a/src/module.c
+++ b/src/module.c
@@ -22,7 +22,16 @@
#include <errno.h>
#include "g10lib.h"
+/* Please match these numbers with the allocated algorithm
+ numbers. */
#define MODULE_ID_MIN 600
+#define MODULE_ID_LAST 65500
+#define MODULE_ID_USER 1024
+#define MODULE_ID_USER_LAST 4095
+
+#if MODULE_ID_MIN >= MODULE_ID_USER
+#error Need to implement a different search strategy
+#endif
/* Internal function. Generate a new, unique module ID for a module
that should be inserted into the module chain starting at
@@ -30,15 +39,19 @@
static gcry_err_code_t
_gcry_module_id_new (gcry_module_t modules, unsigned int *id_new)
{
- /* FIXME, what should be the ID of the first module registered by
- the user? */
- unsigned int id_min = MODULE_ID_MIN, id_max = (unsigned int) -1, mod_id;
+ unsigned int mod_id;
gcry_err_code_t err = GPG_ERR_NO_ERROR;
gcry_module_t module;
/* Search for unused ID. */
- for (mod_id = id_min; mod_id < id_max; mod_id++)
+ for (mod_id = MODULE_ID_MIN; mod_id < MODULE_ID_LAST; mod_id++)
{
+ if (mod_id == MODULE_ID_USER)
+ {
+ mod_id = MODULE_ID_USER_LAST;
+ continue;
+ }
+
/* Search for a module with the current ID. */
for (module = modules; module; module = module->next)
if (mod_id == module->mod_id)
@@ -49,7 +62,7 @@ _gcry_module_id_new (gcry_module_t modules, unsigned int *id_new)
break;
}
- if (mod_id < id_max)
+ if (mod_id < MODULE_ID_LAST)
/* Done. */
*id_new = mod_id;
else
diff --git a/src/sexp.c b/src/sexp.c
index 80fed530..38ab073d 100644
--- a/src/sexp.c
+++ b/src/sexp.c
@@ -190,7 +190,7 @@ normalize ( gcry_sexp_t list )
/* Create a new S-expression object by reading LENGTH bytes from
BUFFER, assuming it is canonilized encoded or autodetected encoding
when AUTODETECT is set to 1. With FREEFNC not NULL, ownership of
- the buffer is transferred to tyhe newle created object. FREEFNC
+ the buffer is transferred to the newly created object. FREEFNC
should be the freefnc used to release BUFFER; there is no guarantee
at which point this function is called; most likey you want to use
free() or gcry_free().
@@ -239,7 +239,7 @@ gcry_sexp_create (gcry_sexp_t *retsexp, void *buffer, size_t length,
have changed the internal represenation of S-expression to
the canoncial format - which has the advantage of faster
parsing - we will use this function as a closure in our
- GCRYSEXP object and use the BUFFER directly */
+ GCRYSEXP object and use the BUFFER directly. */
freefnc (buffer);
}
return gcry_error (GPG_ERR_NO_ERROR);