mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
add-key works
This commit is contained in:
parent
f9a7043782
commit
eed2faab53
69 changed files with 2342 additions and 821 deletions
24
g10/encode.c
24
g10/encode.c
|
@ -112,13 +112,10 @@ encode_simple( const char *filename, int mode )
|
|||
|
||||
if( opt.armor )
|
||||
iobuf_push_filter( out, armor_filter, &afx );
|
||||
|
||||
write_comment( out, "#created by GNUPG v" VERSION " ("
|
||||
else
|
||||
write_comment( out, "#created by GNUPG v" VERSION " ("
|
||||
PRINTABLE_OS_NAME ")");
|
||||
|
||||
if( opt.compress )
|
||||
iobuf_push_filter( out, compress_filter, &zfx );
|
||||
|
||||
if( s2k ) {
|
||||
PKT_symkey_enc *enc = m_alloc_clear( sizeof *enc );
|
||||
enc->version = 4;
|
||||
|
@ -150,11 +147,14 @@ encode_simple( const char *filename, int mode )
|
|||
pt->buf = inp;
|
||||
pkt.pkttype = PKT_PLAINTEXT;
|
||||
pkt.pkt.plaintext = pt;
|
||||
cfx.datalen = filesize? calc_packet_length( &pkt ) : 0;
|
||||
cfx.datalen = filesize && !opt.compress ? calc_packet_length( &pkt ) : 0;
|
||||
|
||||
/* register the cipher filter */
|
||||
if( mode )
|
||||
iobuf_push_filter( out, cipher_filter, &cfx );
|
||||
/* register the compress filter */
|
||||
if( opt.compress )
|
||||
iobuf_push_filter( out, compress_filter, &zfx );
|
||||
|
||||
/* do the work */
|
||||
if( (rc = build_packet( out, &pkt )) )
|
||||
|
@ -211,13 +211,10 @@ encode_crypt( const char *filename, STRLIST remusr )
|
|||
|
||||
if( opt.armor )
|
||||
iobuf_push_filter( out, armor_filter, &afx );
|
||||
|
||||
write_comment( out, "#created by GNUPG v" VERSION " ("
|
||||
else
|
||||
write_comment( out, "#created by GNUPG v" VERSION " ("
|
||||
PRINTABLE_OS_NAME ")");
|
||||
|
||||
if( opt.compress )
|
||||
iobuf_push_filter( out, compress_filter, &zfx );
|
||||
|
||||
/* create a session key */
|
||||
cfx.dek = m_alloc_secure( sizeof *cfx.dek );
|
||||
cfx.dek->algo = opt.def_cipher_algo;
|
||||
|
@ -249,10 +246,13 @@ encode_crypt( const char *filename, STRLIST remusr )
|
|||
init_packet(&pkt);
|
||||
pkt.pkttype = PKT_PLAINTEXT;
|
||||
pkt.pkt.plaintext = pt;
|
||||
cfx.datalen = filesize? calc_packet_length( &pkt ) : 0;
|
||||
cfx.datalen = filesize && !opt.compress? calc_packet_length( &pkt ) : 0;
|
||||
|
||||
/* register the cipher filter */
|
||||
iobuf_push_filter( out, cipher_filter, &cfx );
|
||||
/* register the compress filter */
|
||||
if( opt.compress )
|
||||
iobuf_push_filter( out, compress_filter, &zfx );
|
||||
|
||||
/* do the work */
|
||||
if( (rc = build_packet( out, &pkt )) )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue