mirror of
git://git.gnupg.org/gnupg.git
synced 2025-02-01 16:33:02 +01:00
* armor.c (fake_packet): Allow arbitrary dash-escaped lines as per
2440bis-10. This is bug #158.
This commit is contained in:
parent
5887f2fb26
commit
0d6defc0da
@ -1,5 +1,8 @@
|
||||
2004-10-13 David Shaw <dshaw@jabberwocky.com>
|
||||
|
||||
* 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
|
||||
|
39
g10/armor.c
39
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 */
|
||||
|
Loading…
x
Reference in New Issue
Block a user