aboutsummaryrefslogtreecommitdiffstats
path: root/sm
diff options
context:
space:
mode:
Diffstat (limited to 'sm')
-rw-r--r--sm/ChangeLog5
-rw-r--r--sm/base64.c5
-rw-r--r--sm/decrypt.c8
3 files changed, 16 insertions, 2 deletions
diff --git a/sm/ChangeLog b/sm/ChangeLog
index 846388f81..e47057eb7 100644
--- a/sm/ChangeLog
+++ b/sm/ChangeLog
@@ -1,3 +1,8 @@
+2002-03-06 Werner Koch <[email protected]>
+
+ * base64.c (base64_reader_cb): Use case insensitive compare of the
+ Content-Type string to detect plain base-64.
+
2002-03-05 Werner Koch <[email protected]>
* gpgsm.c, gpgsm.h: Add local_user.
diff --git a/sm/base64.c b/sm/base64.c
index bf1aea179..e7a1ae9ae 100644
--- a/sm/base64.c
+++ b/sm/base64.c
@@ -224,8 +224,9 @@ base64_reader_cb (void *cb_value, char *buffer, size_t count, size_t *nread)
parm->linelen = parm->readpos = 0;
}
else if ( parm->have_lf && parm->line_counter == 1
- && !strncmp (parm->line, "Content-Type:", 13))
- { /* Might be a S/MIME body */
+ && parm->linelen >= 13
+ && !ascii_memcasecmp (parm->line, "Content-Type:", 13))
+ { /* might be a S/MIME body */
parm->might_be_smime = 1;
parm->linelen = parm->readpos = 0;
goto next;
diff --git a/sm/decrypt.c b/sm/decrypt.c
index d16bb59e4..382ec0975 100644
--- a/sm/decrypt.c
+++ b/sm/decrypt.c
@@ -79,6 +79,14 @@ prepare_decryption (const char *hexkeygrip, KsbaConstSexp enc_val,
goto leave;
}
+ /* FIXME: Actually the leading zero is required but due to the way
+ we encode the output in libgcrypt as an MPI we are not able to
+ encode that leading zero. However, when using a Smartcard we are
+ doing it the rightway and therefore we have skip the zero. This
+ should be fixed in gpg-agent of course. */
+ if (!seskey[n])
+ n++;
+
if (seskey[n] != 2 ) /* wrong block type version */
{
rc = seterr (Invalid_Session_Key);