aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Shaw <[email protected]>2004-10-13 20:39:54 +0000
committerDavid Shaw <[email protected]>2004-10-13 20:39:54 +0000
commit0d6defc0daf59c3154e44d34739901d3fce09985 (patch)
tree73471db31f17e7a1e4c895829fddd2024f409a7a
parent* keyserver.c (keyserver_work): Handle keyserver timeouts. (diff)
downloadgnupg-0d6defc0daf59c3154e44d34739901d3fce09985.tar.gz
gnupg-0d6defc0daf59c3154e44d34739901d3fce09985.zip
* armor.c (fake_packet): Allow arbitrary dash-escaped lines as per
2440bis-10. This is bug #158.
Diffstat (limited to '')
-rw-r--r--g10/ChangeLog3
-rw-r--r--g10/armor.c39
2 files changed, 22 insertions, 20 deletions
diff --git a/g10/ChangeLog b/g10/ChangeLog
index d6ba72f3c..ff667db0f 100644
--- a/g10/ChangeLog
+++ b/g10/ChangeLog
@@ -1,5 +1,8 @@
2004-10-13 David Shaw <[email protected]>
+ * armor.c (fake_packet): Allow arbitrary dash-escaped lines as per
+ 2440bis-10. This is bug #158.
+
* keyserver.c (keyserver_work): Handle keyserver timeouts.
* pkclist.c (do_edit_ownertrust): Different prompt when we're
diff --git a/g10/armor.c b/g10/armor.c
index 6d2747237..489f73dcc 100644
--- a/g10/armor.c
+++ b/g10/armor.c
@@ -545,32 +545,31 @@ fake_packet( armor_filter_context_t *afx, IOBUF a,
p = afx->buffer;
n = afx->buffer_len;
- if( n > 2 && *p == '-' ) {
+ if( n > 2 && *p == '-' )
+ {
/* check for dash escaped or armor header */
- if( p[1] == ' ' && !afx->not_dash_escaped ) {
- /* issue a warning if it is not regular encoded */
- if( p[2] != '-' && !( n > 6 && !memcmp(p+2, "From ", 5))) {
- log_info(_("invalid dash escaped line: "));
- print_string( stderr, p, n, 0 );
- putc('\n', stderr);
- }
+ if( p[1] == ' ' && !afx->not_dash_escaped )
+ {
+ /* It's a dash-escaped line */
afx->buffer_pos = 2; /* skip */
- }
- else if( n >= 15 && p[1] == '-' && p[2] == '-' && p[3] == '-' ) {
+ }
+ else if( n >= 15 && p[1] == '-' && p[2] == '-' && p[3] == '-' )
+ {
+ /* It's armor header */
int type = is_armor_header( p, n );
if( afx->not_dash_escaped && type != BEGIN_SIGNATURE )
- ; /* this is okay */
+ ; /* this is okay */
else {
- if( type != BEGIN_SIGNATURE ) {
- log_info(_("unexpected armor: "));
- print_string( stderr, p, n, 0 );
- putc('\n', stderr);
- }
- lastline = 1;
- rc = -1;
+ if( type != BEGIN_SIGNATURE ) {
+ log_info(_("unexpected armor: "));
+ print_string( stderr, p, n, 0 );
+ putc('\n', stderr);
+ }
+ lastline = 1;
+ rc = -1;
}
- }
- }
+ }
+ }
}
if( lastline ) { /* write last (ending) length header */