summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMoritz Schulte <mo@g10code.com>2005-11-02 16:41:33 +0000
committerMoritz Schulte <mo@g10code.com>2005-11-02 16:41:33 +0000
commitbb474fbf697bdd501d0898a49be03a9d267626ef (patch)
tree54ea04800c8de387f8600ac5ccedf64badfdb13c
parentab93d34dcdc2ca01a54a0389448649a2b2c0f7fc (diff)
downloadlibgcrypt-bb474fbf697bdd501d0898a49be03a9d267626ef.tar.gz
src/ChangeLog
src/gcrypt.h TODO cipher/pubkey.c cipher/cipher.c cipher/ChangeLog
-rw-r--r--TODO3
-rw-r--r--cipher/ChangeLog6
-rw-r--r--cipher/cipher.c13
-rw-r--r--cipher/pubkey.c13
-rw-r--r--cipher/random.c2
-rw-r--r--src/ChangeLog5
-rw-r--r--src/gcrypt.h16
-rw-r--r--tests/Makefile.am3
8 files changed, 42 insertions, 19 deletions
diff --git a/TODO b/TODO
index d35aa464..43a432b4 100644
--- a/TODO
+++ b/TODO
@@ -33,3 +33,6 @@ What's left to do -*- outline -*-
Don't rely on the secure memory based wiping function but add an
extra wiping.
+* update/improve documentation
+ - it's outdated for e.g. gcry_pk_algo_info.
+ - document algorithm capabilities
diff --git a/cipher/ChangeLog b/cipher/ChangeLog
index 2270dbe8..57cbeed4 100644
--- a/cipher/ChangeLog
+++ b/cipher/ChangeLog
@@ -1,3 +1,9 @@
+2005-11-02 Moritz Schulte <moritz@g10code.com>
+
+ * pubkey.c (gcry_pk_algo_name): Return "?" instead of NULL for
+ unknown algorithm IDs.
+ * cipher.c (cipher_algo_to_string): Likewise.
+
2005-11-01 Moritz Schulte <moritz@g10code.com>
* pubkey.c (gcry_pk_algo_info): Don't forget to break after switch
diff --git a/cipher/cipher.c b/cipher/cipher.c
index 24e94e1c..087a3478 100644
--- a/cipher/cipher.c
+++ b/cipher/cipher.c
@@ -1,5 +1,6 @@
/* cipher.c - cipher dispatcher
- * Copyright (C) 1998,1999,2000,2001,2002,2003 Free Software Foundation, Inc.
+ * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003
+ * 2005, Free Software Foundation, Inc.
*
* This file is part of Libgcrypt.
*
@@ -378,14 +379,14 @@ gcry_cipher_mode_from_oid (const char *string)
}
-/* Map the cipher algorithm identifier ALGORITHM to a string
- representing this algorithm. This string is the default name as
- used by Libgcrypt. NULL is returned for an unknown algorithm. */
+/* Map the cipher algorithm whose ID is contained in ALGORITHM to a
+ string representation of the algorithm name. For unknown algorithm
+ IDs this function returns "?". */
static const char *
cipher_algo_to_string (int algorithm)
{
gcry_module_t cipher;
- const char *name = NULL;
+ const char *name;
REGISTER_DEFAULT_CIPHERS;
@@ -396,6 +397,8 @@ cipher_algo_to_string (int algorithm)
name = ((gcry_cipher_spec_t *) cipher->spec)->name;
_gcry_module_release (cipher);
}
+ else
+ name = "?";
ath_mutex_unlock (&ciphers_registered_lock);
return name;
diff --git a/cipher/pubkey.c b/cipher/pubkey.c
index 1ca13ba4..8aa13c2e 100644
--- a/cipher/pubkey.c
+++ b/cipher/pubkey.c
@@ -1,5 +1,6 @@
/* pubkey.c - pubkey dispatcher
- * Copyright (C) 1998,1999,2000,2002,2003 Free Software Foundation, Inc.
+ * Copyright (C) 1998, 1999, 2000, 2002, 2003,
+ * 2005 Free Software Foundation, Inc.
*
* This file is part of Libgcrypt.
*
@@ -266,14 +267,14 @@ gcry_pk_map_name (const char *string)
}
-/****************
- * Map a pubkey algo to a string
- */
+/* Map the public key algorithm whose ID is contained in ALGORITHM to
+ a string representation of the algorithm name. For unknown
+ algorithm IDs this functions returns "?". */
const char *
gcry_pk_algo_name (int algorithm)
{
- const char *name = NULL;
gcry_module_t pubkey;
+ const char *name;
REGISTER_DEFAULT_PUBKEYS;
@@ -284,6 +285,8 @@ gcry_pk_algo_name (int algorithm)
name = ((gcry_pk_spec_t *) pubkey->spec)->name;
_gcry_module_release (pubkey);
}
+ else
+ name = "?";
ath_mutex_unlock (&pubkeys_registered_lock);
return name;
diff --git a/cipher/random.c b/cipher/random.c
index 1b60ade9..177cd6f9 100644
--- a/cipher/random.c
+++ b/cipher/random.c
@@ -208,6 +208,8 @@ _gcry_random_initialize (int full)
void
_gcry_random_dump_stats()
{
+ /* FIXME: don't we need proper locking here? -mo */
+
log_info (
"random usage: poolsize=%d mixed=%lu polls=%lu/%lu added=%lu/%lu\n"
" outmix=%lu getlvl1=%lu/%lu getlvl2=%lu/%lu\n",
diff --git a/src/ChangeLog b/src/ChangeLog
index b31e61df..d5a28257 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
+2005-11-02 Moritz Schulte <moritz@g10code.com>
+
+ * gcrypt.h: Update comments for functions: gcry_cipher_algo_name,
+ gcry_pk_algo_name.
+
2005-10-31 Moritz Schulte <moritz@g10code.com>
* global.c: Added documentation.
diff --git a/src/gcrypt.h b/src/gcrypt.h
index f0eceee3..63e7de9d 100644
--- a/src/gcrypt.h
+++ b/src/gcrypt.h
@@ -780,10 +780,10 @@ gcry_error_t gcry_cipher_info (gcry_cipher_hd_t h, int what, void *buffer,
gcry_error_t gcry_cipher_algo_info (int algo, int what, void *buffer,
size_t *nbytes);
-/* Map the cipher algorithm id ALGO to a string representation of that
- algorithm name. For unknown algorithms this functions returns an
- empty string. */
-const char *gcry_cipher_algo_name (int algo) _GCRY_GCC_ATTR_PURE;
+/* Map the cipher algorithm whose ID is contained in ALGORITHM to a
+ string representation of the algorithm name. For unknown algorithm
+ IDs this function returns "?". */
+const char *gcry_cipher_algo_name (int algorithm) _GCRY_GCC_ATTR_PURE;
/* Map the algorithm name NAME to an cipher algorithm ID. Return 0 if
the algorithm name is not known. */
@@ -908,10 +908,10 @@ gcry_error_t gcry_pk_ctl (int cmd, void *buffer, size_t buflen);
gcry_error_t gcry_pk_algo_info (int algo, int what,
void *buffer, size_t *nbytes);
-/* Map the public key algorithm id ALGO to a string representation of the
- algorithm name. For unknown algorithms this functions returns an
- empty string. */
-const char *gcry_pk_algo_name (int algo) _GCRY_GCC_ATTR_PURE;
+/* Map the public key algorithm whose ID is contained in ALGORITHM to
+ a string representation of the algorithm name. For unknown
+ algorithm IDs this functions returns "?". */
+const char *gcry_pk_algo_name (int algorithm) _GCRY_GCC_ATTR_PURE;
/* Map the algorithm NAME to a public key algorithm Id. Return 0 if
the algorithm name is not known. */
diff --git a/tests/Makefile.am b/tests/Makefile.am
index cf877ae6..454d3003 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -19,7 +19,8 @@
## Process this file with automake to produce Makefile.in
TESTS = prime register ac ac-schemes ac-data basic \
- tsexp keygen pubkey benchmark pkbench hmac keygrip
+ tsexp keygen pubkey benchmark pkbench hmac keygrip full \
+ mpi-zero mpi-cmp
INCLUDES = -I$(top_srcdir)/src
LDADD = ../src/libgcrypt.la