1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-06-11 23:59:50 +02:00

I believe clearsig works

This commit is contained in:
Werner Koch 1998-02-05 08:54:39 +00:00
parent 9886ad8098
commit e6f72aa347
2 changed files with 13 additions and 4 deletions

View File

@ -72,6 +72,7 @@ typedef enum {
fhdrCHECKDashEscaped3, fhdrCHECKDashEscaped3,
fhdrREADClearsigNext, fhdrREADClearsigNext,
fhdrENDClearsig, fhdrENDClearsig,
fhdrENDClearsigHelp,
fhdrTESTSpaces, fhdrTESTSpaces,
fhdrTEXT, fhdrTEXT,
fhdrERROR, fhdrERROR,
@ -291,7 +292,7 @@ find_header( fhdr_state_t state, byte *buf, size_t *r_buflen,
state = fhdrCHECKDashEscaped3; state = fhdrCHECKDashEscaped3;
} }
else { else {
/* fixme: we should check wether this linee continues /* fixme: we should check wether this line continues
* it is poosible that we have only read ws until here * it is poosible that we have only read ws until here
* and more stuff is to come */ * and more stuff is to come */
state = fhdrEOF; state = fhdrEOF;
@ -565,6 +566,12 @@ fake_packet( armor_filter_context_t *afx, IOBUF a,
} }
continue; continue;
} }
if( state == fhdrENDClearsigHelp ) {
state = fhdrENDClearsig;
afx->faked = 0;
rc = -1;
continue;
}
if( afx->helpidx < afx->helplen ) { /* flush the last buffer */ if( afx->helpidx < afx->helplen ) { /* flush the last buffer */
n = afx->helplen; n = afx->helplen;
for(nn=afx->helpidx; len < size && nn < n ; nn++ ) for(nn=afx->helpidx; len < size && nn < n ; nn++ )
@ -598,9 +605,11 @@ fake_packet( armor_filter_context_t *afx, IOBUF a,
break; break;
case fhdrENDClearsig: case fhdrENDClearsig:
log_debug("endclearsig: emplines=%u n=%u\n", emplines, n );
assert( emplines );
emplines--; /* don't count the last one */
state = fhdrENDClearsigHelp;
afx->helplen = n; afx->helplen = n;
afx->faked = 0;
rc = -1;
break; break;
default: BUG(); default: BUG();

View File

@ -376,7 +376,7 @@ clearsign_file( const char *fname, STRLIST locusr, const char *outfile )
if( rc ) if( rc )
goto leave; goto leave;
iobuf_writestr(out, "\n\n" ); iobuf_writestr(out, "\n" );
afx.what = 2; afx.what = 2;
iobuf_push_filter( out, armor_filter, &afx ); iobuf_push_filter( out, armor_filter, &afx );