aboutsummaryrefslogtreecommitdiffstats
path: root/g10/sign.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>1998-11-20 17:42:18 +0000
committerWerner Koch <[email protected]>1998-11-20 17:42:18 +0000
commit47c61bafe3545f17e8244902dca0ff00077d0feb (patch)
tree0867aa7d405a1df94ac360b5cc2814e97dcbe115 /g10/sign.c
parentsome bug fixes (diff)
downloadgnupg-47c61bafe3545f17e8244902dca0ff00077d0feb.tar.gz
gnupg-47c61bafe3545f17e8244902dca0ff00077d0feb.zip
Expiration time works (I hope so)
Diffstat (limited to 'g10/sign.c')
-rw-r--r--g10/sign.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/g10/sign.c b/g10/sign.c
index 71b5108f0..52f36f937 100644
--- a/g10/sign.c
+++ b/g10/sign.c
@@ -458,6 +458,22 @@ write_dash_escaped( IOBUF inp, IOBUF out, MD_HANDLE md )
int lastlf = 1;
int state = 0;
+ if( opt.not_dash_escaped ) {
+ lastlf = 0;
+ while( (c = iobuf_get(inp)) != -1 ) {
+ md_putc(md, c );
+ iobuf_put( out, c );
+ lastlf = c;
+ }
+ if( lastlf != '\n' ) {
+ /* add a missing trailing LF */
+ md_putc(md, '\n' );
+ iobuf_put( out, '\n' );
+ }
+
+ return 0;
+ }
+
while( (c = iobuf_get(inp)) != -1 ) {
/* Note: We don't escape "From " because the MUA should cope with it */
if( lastlf ) {
@@ -579,7 +595,11 @@ clearsign_file( const char *fname, STRLIST locusr, const char *outfile )
}
}
assert(any);
- iobuf_writestr(out, "\n\n" );
+ iobuf_writestr(out, "\n" );
+ if( opt.not_dash_escaped )
+ iobuf_writestr( out,
+ "NotDashEscaped: You need GnuPG to verify this message\n" );
+ iobuf_writestr(out, "\n" );
}
@@ -588,7 +608,8 @@ clearsign_file( const char *fname, STRLIST locusr, const char *outfile )
PKT_secret_key *sk = sk_rover->sk;
md_enable(textmd, hash_for(sk->pubkey_algo));
}
- iobuf_push_filter( inp, text_filter, &tfx );
+ if( !opt.not_dash_escaped )
+ iobuf_push_filter( inp, text_filter, &tfx );
rc = write_dash_escaped( inp, out, textmd );
if( rc )
goto leave;