dirmngr/src (ChangeLog dirmngr-client.c)
cvs user wk
cvs at cvs.gnupg.org
Wed Jan 5 21:00:38 CET 2005
Date: Wednesday, January 5, 2005 @ 21:07:08
Author: wk
Path: /cvs/dirmngr/dirmngr/src
Modified: ChangeLog dirmngr-client.c
(read_pem_certificate): Skip trailing percent
escaped linefeeds.
------------------+
ChangeLog | 5 +++++
dirmngr-client.c | 18 ++++++++++++------
2 files changed, 17 insertions(+), 6 deletions(-)
Index: dirmngr/src/ChangeLog
diff -u dirmngr/src/ChangeLog:1.40 dirmngr/src/ChangeLog:1.41
--- dirmngr/src/ChangeLog:1.40 Mon Jan 3 21:42:46 2005
+++ dirmngr/src/ChangeLog Wed Jan 5 21:07:08 2005
@@ -1,3 +1,8 @@
+2005-01-05 Werner Koch <wk at g10code.com>
+
+ * dirmngr-client.c (read_pem_certificate): Skip trailing percent
+ escaped linefeeds.
+
2005-01-03 Werner Koch <wk at g10code.com>
* dirmngr-client.c (read_pem_certificate): New.
Index: dirmngr/src/dirmngr-client.c
diff -u dirmngr/src/dirmngr-client.c:1.7 dirmngr/src/dirmngr-client.c:1.8
--- dirmngr/src/dirmngr-client.c:1.7 Mon Jan 3 21:42:46 2005
+++ dirmngr/src/dirmngr-client.c Wed Jan 5 21:07:08 2005
@@ -566,6 +566,8 @@
buflen = 0;
while ((c=getc (fp)) != EOF)
{
+ int escaped_c = 0;
+
if (opt.escaped_pem)
{
if (c == '%')
@@ -581,9 +583,13 @@
{
log_error ("invalid percent escape sequence\n");
state = s_idle; /* Force an error. */
- break;
+ /* Skip to end of line. */
+ while ( (c=getc (fp)) != EOF && c != '\n')
+ ;
+ goto ready;
}
c = xtoi_2 (tmp);
+ escaped_c = 1;
}
else if (c == '\n')
goto ready; /* Ready. */
@@ -654,11 +660,11 @@
}
break;
case s_waitend:
- /* Note that we do not check whether the END line really
- follows, nor did we check that the base64 decoder was
- left in the expected state. We assume that the PEM
- header is just fine. */
- if (c== '\n')
+ /* Note that we do not check that the base64 decoder has
+ been left in the expected state. We assume that the PEM
+ header is just fine. However we need to wait for the
+ real LF and not a trailing percent escaped one. */
+ if (c== '\n' && !escaped_c)
goto ready;
break;
default:
More information about the Gnupg-commits
mailing list