summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2003-01-15 14:02:01 +0000
committerWerner Koch <wk@gnupg.org>2003-01-15 14:02:01 +0000
commitb72cee46eea13d6f8c9a47703693c809c2f0c65d (patch)
tree5dafc9d845fedeb45e8ffe64c7cc344af3cd7450 /src
parent6fb130c964f71e34d6c62d0befc11c31c40075ea (diff)
downloadlibgcrypt-b72cee46eea13d6f8c9a47703693c809c2f0c65d.tar.gz
* basic.c (verify_one_signature,check_pubkey_sign)
(check_pubkey): New. (main): Check public key functions. Add a --debug option. * sexp.c (gcry_sexp_length): Fixed. This was seriously broken. * pubkey.c (sexp_data_to_mpi): New. This handles pkcs1 padding. (gcry_pk_sign, gcry_pk_verify): Use it here. (gcry_pk_encrypt): And here. (pubkey_verify): Add debug code. (sexp_to_enc): Handle flags in the input and return the pkcs1 flag in a new parameter. (gcry_pk_decrypt): Prepare for future pkcs1 handling.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog8
-rw-r--r--src/gcrypt.h5
-rw-r--r--src/global.c1
-rw-r--r--src/sexp.c9
-rw-r--r--src/testapi.c1
5 files changed, 16 insertions, 8 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 9d5fbed4..f7b918db 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,11 @@
+2003-01-15 Werner Koch <wk@gnupg.org>
+
+ * sexp.c (gcry_sexp_length): Fixed. This was seriously broken.
+
+2003-01-14 Werner Koch <wk@gnupg.org>
+
+ * gcrypt.h (GCRYERR_INV_FLAG), global.c (gcry_strerror): New.
+
2003-01-02 Werner Koch <wk@gnupg.org>
* libgcrypt.vers: Temporary export _gcry_generate_elg_prime for
diff --git a/src/gcrypt.h b/src/gcrypt.h
index b4f046d5..adb76e03 100644
--- a/src/gcrypt.h
+++ b/src/gcrypt.h
@@ -37,7 +37,7 @@ extern "C" {
autoconf (using the AM_PATH_GCRYPT macro) check that this header
matches the installed library. Note: Do not edit the next line as
configure may fix the string here. */
-#define GCRYPT_VERSION "1.1.11"
+#define GCRYPT_VERSION "1.1.12-cvs"
/* Internal: We can't use the convenience macros for the multi
precision integer functions when building this library. */
@@ -99,12 +99,13 @@ enum
GCRYERR_INTERNAL = 63, /* internal error */
GCRYERR_EOF = 64, /* (-1) is remapped to this value */
GCRYERR_INV_OBJ = 65, /* an object is not valid */
- GCRYERR_TOO_SHORT = 66, /* provided buffer too short */
+ GCRYERR_TOO_SHORT = 66, /* provided buffer/object too short */
GCRYERR_TOO_LARGE = 67, /* object is too large */
GCRYERR_NO_OBJ = 68, /* Missing item in an object */
GCRYERR_NOT_IMPL = 69, /* Not implemented */
GCRYERR_CONFLICT = 70, /* conflicting use of functions/values */
GCRYERR_INV_CIPHER_MODE = 71, /* invalid/unsupported cipher mode */
+ GCRYERR_INV_FLAG = 72, /* invalid flag */
/* error codes pertaining to S-expressions */
GCRYERR_SEXP_INV_LEN_SPEC = 201,
diff --git a/src/global.c b/src/global.c
index 8c1bc25e..90694d08 100644
--- a/src/global.c
+++ b/src/global.c
@@ -298,6 +298,7 @@ gcry_strerror( int ec )
X(NOT_IMPL, N_("not implemented"))
X(CONFLICT, N_("conflict"))
X(INV_CIPHER_MODE,N_("invalid cipher mode"))
+ X(INV_FLAG, N_("invalid flag"))
X(SEXP_INV_LEN_SPEC ,N_("invalid length specification"))
X(SEXP_STRING_TOO_LONG,N_("string too long"))
diff --git a/src/sexp.c b/src/sexp.c
index aea3a5fa..bda2484f 100644
--- a/src/sexp.c
+++ b/src/sexp.c
@@ -383,7 +383,7 @@ gcry_sexp_find_token( const GCRY_SEXP list, const char *tok, size_t toklen )
}
/****************
- * return the length of the given list
+ * Return the length of the given list
*/
int
gcry_sexp_length( const GCRY_SEXP list )
@@ -401,14 +401,13 @@ gcry_sexp_length( const GCRY_SEXP list )
while ( (type=*p) != ST_STOP ) {
p++;
if ( type == ST_DATA ) {
- memcpy ( &n, ++p, sizeof n );
+ memcpy ( &n, p, sizeof n );
p += sizeof n + n;
- p--;
- if ( !level )
+ if ( level == 1 )
length++;
}
else if ( type == ST_OPEN ) {
- if ( !level )
+ if ( level == 1 )
length++;
level++;
}
diff --git a/src/testapi.c b/src/testapi.c
index a9b724f3..0dde34c2 100644
--- a/src/testapi.c
+++ b/src/testapi.c
@@ -110,4 +110,3 @@ main( int argc, char **argv )
return 0;
}
-