1
1
/* encode.c - encode data
2
* Copyright (C) 1998, 1999, 2000, 2001, 2002,
3
* 2003 Free Software Foundation, Inc.
2
* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
3
* 2006 Free Software Foundation, Inc.
5
5
* This file is part of GnuPG.
7
7
* GnuPG is free software; you can redistribute it and/or modify
8
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation; either version 2 of the License, or
9
* the Free Software Foundation; either version 3 of the License, or
10
10
* (at your option) any later version.
12
12
* GnuPG is distributed in the hope that it will be useful,
75
61
encode_store( const char *filename )
77
return encode_simple( filename, 0, 1 );
63
return encode_simple( filename, 0, 0 );
81
encode_sesskey (DEK * dek, DEK ** ret_dek, byte * enckey)
68
encode_seskey( DEK *dek, DEK **seskey, byte *enckey )
87
assert (dek->keylen < 32);
89
c = xcalloc (1, sizeof *c);
90
c->keylen = dek->keylen;
93
/*log_hexdump ("thekey", c->key, c->keylen);*/
95
/* the encrypted session key is prefixed with a one-octet algorithm id */
97
memcpy (buf + 1, c->key, c->keylen);
99
/* due to the fact that we use only checked values, consider each
101
if (gcry_cipher_open (&hd, dek->algo, GCRY_CIPHER_MODE_CFB, 1))
103
if (gcry_cipher_setkey (hd, dek->key, dek->keylen))
105
gcry_cipher_setiv (hd, NULL, 0);
106
gcry_cipher_encrypt (hd, buf, c->keylen + 1, NULL, 0);
107
gcry_cipher_close (hd);
109
memcpy (enckey, buf, c->keylen + 1);
110
wipememory (buf, sizeof buf); /* burn key */
73
assert ( dek->keylen <= 32 );
76
*seskey=xmalloc_clear(sizeof(DEK));
77
(*seskey)->keylen=dek->keylen;
78
(*seskey)->algo=dek->algo;
79
make_session_key(*seskey);
80
/*log_hexdump( "thekey", c->key, c->keylen );*/
83
/* The encrypted session key is prefixed with a one-octet algorithm id. */
84
buf[0] = (*seskey)->algo;
85
memcpy( buf + 1, (*seskey)->key, (*seskey)->keylen );
87
/* We only pass already checked values to the following fucntion,
88
thus we consider any failure as fatal. */
89
if (gcry_cipher_open (&hd, dek->algo, GCRY_CIPHER_MODE_CFB, 1))
91
if (gcry_cipher_setkey (hd, dek->key, dek->keylen))
93
gcry_cipher_setiv (hd, NULL, 0);
94
gcry_cipher_encrypt (hd, buf, (*seskey)->keylen + 1, NULL, 0);
95
gcry_cipher_close (hd);
97
memcpy( enckey, buf, (*seskey)->keylen + 1 );
98
wipememory( buf, sizeof buf ); /* burn key */
114
101
/* We try very hard to use a MDC */
116
use_mdc (PK_LIST pk_list,int algo)
103
use_mdc(PK_LIST pk_list,int algo)
118
byte cipher_algid[4] = {
126
105
/* RFC-1991 and 2440 don't have MDC */
127
106
if(RFC1991 || RFC2440)
130
109
/* --force-mdc overrides --disable-mdc */
137
116
/* Do the keys really support MDC? */
139
if (select_mdc_from_pklist (pk_list))
118
if(select_mdc_from_pklist(pk_list))
142
121
/* The keys don't support MDC, so now we do a bit of a hack - if any
144
123
can handle a MDC. This is valid for PGP 7, which can handle MDCs
145
124
though it will not generate them. 2440bis allows this, by the
147
for (i=0; i < DIM (cipher_algid); i++)
149
if (select_algo_from_prefs (pk_list, PREFTYPE_SYM, cipher_algid[i],
150
NULL) == cipher_algid[i])
127
if(select_algo_from_prefs(pk_list,PREFTYPE_SYM,
128
CIPHER_ALGO_AES,NULL)==CIPHER_ALGO_AES)
131
if(select_algo_from_prefs(pk_list,PREFTYPE_SYM,
132
CIPHER_ALGO_AES192,NULL)==CIPHER_ALGO_AES192)
135
if(select_algo_from_prefs(pk_list,PREFTYPE_SYM,
136
CIPHER_ALGO_AES256,NULL)==CIPHER_ALGO_AES256)
139
if(select_algo_from_prefs(pk_list,PREFTYPE_SYM,
140
CIPHER_ALGO_TWOFISH,NULL)==CIPHER_ALGO_TWOFISH)
154
143
/* Last try. Use MDC for the modern ciphers. */
155
145
if (gcry_cipher_get_algo_blklen (algo) != 8)
149
warn_missing_mdc_from_pklist (pk_list);
158
151
return 0; /* No MDC */
154
/* We don't want to use use_seskey yet because older gnupg versions
155
can't handle it, and there isn't really any point unless we're
156
making a message that can be decrypted by a public key or
162
encode_simple( const char *filename, int mode, int compat )
159
encode_simple( const char *filename, int mode, int use_seskey )
167
163
PKT_plaintext *pt = NULL;
168
164
STRING2KEY *s2k = NULL;
171
167
int seskeylen = 0;
173
169
cipher_filter_context_t cfx;
174
armor_filter_context_t afx;
170
armor_filter_context_t *afx = NULL;
175
171
compress_filter_context_t zfx;
176
172
text_filter_context_t tfx;
177
progress_filter_context_t pfx;
178
int do_compress = opt.compress && !RFC1991;
173
progress_filter_context_t *pfx;
174
int do_compress = !RFC1991 && default_compress_algo();
176
pfx = new_progress_context ();
180
177
memset( &cfx, 0, sizeof cfx);
181
memset( &afx, 0, sizeof afx);
182
178
memset( &zfx, 0, sizeof zfx);
183
179
memset( &tfx, 0, sizeof tfx);
184
180
init_packet(&pkt);
186
182
/* prepare iobufs */
187
if( !(inp = iobuf_open(filename)) ) {
188
rc = gpg_error_from_errno (errno);
189
log_error(_("%s: can't open: %s\n"), filename? filename: "[stdin]",
183
inp = iobuf_open(filename);
185
iobuf_ioctl (inp,3,1,NULL); /* disable fd caching */
186
if (inp && is_secured_file (iobuf_get_fd (inp)))
193
rc = gpg_error_from_syserror ();
194
log_error(_("can't open `%s': %s\n"), filename? filename: "[stdin]",
196
release_progress_context (pfx);
194
handle_progress (&pfx, inp, filename);
200
handle_progress (pfx, inp, filename);
196
202
if( opt.textmode )
197
203
iobuf_push_filter( inp, text_filter, &tfx );
199
205
/* Due the the fact that we use don't use an IV to encrypt the
200
206
session key we can't use the new mode with RFC1991 because
201
207
it has no S2K salt. RFC1991 always uses simple S2K. */
202
if ( RFC1991 && !compat )
208
if ( RFC1991 && use_seskey )
207
s2k = xcalloc (1, sizeof *s2k );
215
s2k = xmalloc_clear( sizeof *s2k );
208
216
s2k->mode = RFC1991? 0:opt.s2k_mode;
209
s2k->hash_algo = opt.s2k_digest_algo;
217
s2k->hash_algo=S2K_DIGEST_ALGO;
210
218
cfx.dek = passphrase_to_dek( NULL, 0,
211
219
default_cipher_algo(), s2k, 2,
213
221
if( !cfx.dek || !cfx.dek->keylen ) {
214
rc = gpg_error (GPG_ERR_INV_PASSPHRASE);
222
rc = gpg_error (canceled? GPG_ERR_CANCELED:GPG_ERR_INV_PASSPHRASE);
217
225
iobuf_close(inp);
218
log_error(_("error creating passphrase: %s\n"), gpg_strerror (rc) );
226
log_error(_("error creating passphrase: %s\n"), gpg_strerror (rc));
227
release_progress_context (pfx);
221
if (!compat && s2k->mode != 1 && s2k->mode != 3) {
230
if (use_seskey && s2k->mode != 1 && s2k->mode != 3) {
223
232
log_info (_("can't use a symmetric ESK packet "
224
233
"due to the S2K mode\n"));
228
seskeylen = gcry_cipher_get_algo_keylen (default_cipher_algo());
229
encode_sesskey( cfx.dek, &dek, enckey );
230
xfree (cfx.dek); cfx.dek = dek;
240
seskeylen = gcry_cipher_get_algo_keylen (default_cipher_algo ());
241
encode_seskey( cfx.dek, &dek, enckey );
242
xfree( cfx.dek ); cfx.dek = dek;
246
log_info(_("using cipher %s\n"),
247
openpgp_cipher_algo_name (cfx.dek->algo));
233
249
cfx.dek->use_mdc=use_mdc(NULL,cfx.dek->algo);
236
if (opt.compress == -1 && cfx.dek && cfx.dek->use_mdc &&
237
is_file_compressed(filename, &rc))
252
if (do_compress && cfx.dek && cfx.dek->use_mdc
253
&& is_file_compressed(filename, &rc))
240
256
log_info(_("`%s' already compressed\n"), filename);
244
260
if( rc || (rc = open_outfile( filename, opt.armor? 1:0, &out )) ) {
245
261
iobuf_cancel(inp);
264
release_progress_context (pfx);
252
iobuf_push_filter( out, armor_filter, &afx );
253
#ifdef ENABLE_COMMENT_PACKETS
255
write_comment( out, "#created by GNUPG v" VERSION " ("
256
PRINTABLE_OS_NAME ")");
257
if( opt.comment_string )
258
write_comment( out, opt.comment_string );
270
afx = new_armor_context ();
271
push_armor_filter (afx, out);
261
274
if( s2k && !RFC1991 ) {
262
PKT_symkey_enc *enc = xcalloc (1, sizeof *enc + seskeylen + 1 );
275
PKT_symkey_enc *enc = xmalloc_clear( sizeof *enc + seskeylen + 1 );
263
276
enc->version = 4;
264
277
enc->cipher_algo = cfx.dek->algo;
266
if ( !compat && seskeylen ) {
279
if ( use_seskey && seskeylen ) {
267
280
enc->seskeylen = seskeylen + 1; /* algo id */
268
281
memcpy( enc->seskey, enckey, seskeylen + 1 );
270
283
pkt.pkttype = PKT_SYMKEY_ENC;
271
284
pkt.pkt.symkey_enc = enc;
272
285
if( (rc = build_packet( out, &pkt )) )
273
log_error("build symkey packet failed: %s\n", gpg_strerror (rc) );
286
log_error("build symkey packet failed: %s\n", g10_errstr(rc) );
277
if (!opt.no_literal) {
278
/* setup the inner packet */
279
if( filename || opt.set_filename ) {
280
char *s = make_basename ( opt.set_filename ? opt.set_filename
283
.iobuf_get_real_fname( inp ) */
285
pt = xmalloc ( sizeof *pt + strlen(s) - 1 );
286
pt->namelen = strlen(s);
287
memcpy(pt->name, s, pt->namelen );
290
else { /* no filename */
291
pt = xmalloc ( sizeof *pt - 1 );
291
pt=setup_plaintext_name(filename,inp);
296
293
/* Note that PGP 5 has problems decrypting symmetrically encrypted
297
294
data if the file length is in the inner packet. It works when
304
301
either partial length or fixed length with the new style
307
if (filename && *filename && !(*filename == '-' && !filename[1])
304
if ( !iobuf_is_pipe_filename (filename) && *filename && !opt.textmode )
311
if ( !(tmpsize = iobuf_get_filelength(inp)) )
312
log_info(_("%s: WARNING: empty file\n"), filename );
309
if ( !(tmpsize = iobuf_get_filelength(inp, &overflow))
311
log_info(_("WARNING: `%s' is an empty file\n"), filename );
313
312
/* We can't encode the length of very large files because
314
313
OpenPGP uses only 32 bit for file sizes. So if the the
315
314
size of a file is larger than 2^32 minus some bytes for
348
347
if (cfx.dek && cfx.dek->use_mdc)
350
zfx.algo=default_compress_algo();
351
iobuf_push_filter( out, compress_filter, &zfx );
349
push_compress_filter(out,&zfx,default_compress_algo());
354
352
/* do the work */
355
353
if (!opt.no_literal) {
356
354
if( (rc = build_packet( out, &pkt )) )
357
log_error("build_packet failed: %s\n", gpg_strerror (rc) );
355
log_error("build_packet failed: %s\n", g10_errstr(rc) );
360
358
/* user requested not to create a literal packet,
362
360
byte copy_buffer[4096];
363
361
int bytes_copied;
364
362
while ((bytes_copied = iobuf_read(inp, copy_buffer, 4096)) != -1)
365
if ( (rc=iobuf_write(out, copy_buffer, bytes_copied))) {
366
log_error("copying input to output failed: %s\n", gpg_strerror (rc) );
363
if ( (rc=iobuf_write(out, copy_buffer, bytes_copied)) ) {
364
log_error ("copying input to output failed: %s\n",
369
368
wipememory(copy_buffer, 4096); /* burn buffer */
383
382
free_packet(&pkt);
385
release_armor_context (afx);
386
release_progress_context (pfx);
391
setup_symkey(STRING2KEY **symkey_s2k,DEK **symkey_dek)
395
*symkey_s2k=xmalloc_clear(sizeof(STRING2KEY));
396
(*symkey_s2k)->mode = opt.s2k_mode;
397
(*symkey_s2k)->hash_algo = S2K_DIGEST_ALGO;
399
*symkey_dek=passphrase_to_dek(NULL,0,opt.s2k_cipher_algo,
400
*symkey_s2k,2,NULL, &canceled);
401
if(!*symkey_dek || !(*symkey_dek)->keylen)
405
return gpg_error (canceled?GPG_ERR_CANCELED:GPG_ERR_BAD_PASSPHRASE);
412
write_symkey_enc(STRING2KEY *symkey_s2k,DEK *symkey_dek,DEK *dek,IOBUF out)
414
int rc, seskeylen = gcry_cipher_get_algo_keylen (dek->algo);
420
enc=xmalloc_clear(sizeof(PKT_symkey_enc)+seskeylen+1);
421
encode_seskey(symkey_dek,&dek,enckey);
424
enc->cipher_algo = opt.s2k_cipher_algo;
425
enc->s2k = *symkey_s2k;
426
enc->seskeylen = seskeylen + 1; /* algo id */
427
memcpy( enc->seskey, enckey, seskeylen + 1 );
429
pkt.pkttype = PKT_SYMKEY_ENC;
430
pkt.pkt.symkey_enc = enc;
432
if((rc=build_packet(out,&pkt)))
433
log_error("build symkey_enc packet failed: %s\n",g10_errstr(rc));
389
439
/****************
390
440
* Encrypt the file with the given userids (or ask if none
394
encode_crypt( const char *filename, STRLIST remusr )
444
encode_crypt( const char *filename, strlist_t remusr, int use_symkey )
396
iobuf_t inp = NULL, out = NULL;
446
IOBUF inp = NULL, out = NULL;
398
448
PKT_plaintext *pt = NULL;
449
DEK *symkey_dek = NULL;
450
STRING2KEY *symkey_s2k = NULL;
399
451
int rc = 0, rc2 = 0;
401
453
cipher_filter_context_t cfx;
402
armor_filter_context_t afx;
454
armor_filter_context_t *afx = NULL;
403
455
compress_filter_context_t zfx;
404
456
text_filter_context_t tfx;
405
progress_filter_context_t pfx;
457
progress_filter_context_t *pfx;
406
458
PK_LIST pk_list,work_list;
407
int do_compress = opt.compress && !RFC1991;
459
int do_compress = opt.compress_algo && !RFC1991;
461
pfx = new_progress_context ();
410
462
memset( &cfx, 0, sizeof cfx);
411
memset( &afx, 0, sizeof afx);
412
463
memset( &zfx, 0, sizeof zfx);
413
464
memset( &tfx, 0, sizeof tfx);
414
465
init_packet(&pkt);
468
&& (rc=setup_symkey(&symkey_s2k,&symkey_dek)))
470
release_progress_context (pfx);
416
474
if( (rc=build_pk_list( remusr, &pk_list, PUBKEY_USAGE_ENC)) )
476
release_progress_context (pfx);
420
481
for(work_list=pk_list; work_list; work_list=work_list->next)
431
492
/* prepare iobufs */
432
if( !(inp = iobuf_open(filename)) ) {
433
rc = gpg_error_from_errno (errno);
434
log_error(_("can't open %s: %s\n"), filename? filename: "[stdin]",
493
inp = iobuf_open(filename);
495
iobuf_ioctl (inp,3,1,NULL); /* disable fd caching */
496
if (inp && is_secured_file (iobuf_get_fd (inp)))
503
rc = gpg_error_from_syserror ();
504
log_error(_("can't open `%s': %s\n"),
505
filename? filename: "[stdin]",
438
509
else if( opt.verbose )
439
510
log_info(_("reading from `%s'\n"), filename? filename: "[stdin]");
441
handle_progress (&pfx, inp, filename);
512
handle_progress (pfx, inp, filename);
443
514
if( opt.textmode )
444
515
iobuf_push_filter( inp, text_filter, &tfx );
446
517
if( (rc = open_outfile( filename, opt.armor? 1:0, &out )) )
522
afx = new_armor_context ();
523
push_armor_filter (afx, out);
451
iobuf_push_filter( out, armor_filter, &afx );
452
#ifdef ENABLE_COMMENT_PACKETS
454
write_comment( out, "#created by GNUPG v" VERSION " ("
455
PRINTABLE_OS_NAME ")");
456
if( opt.comment_string )
457
write_comment( out, opt.comment_string );
460
526
/* create a session key */
461
cfx.dek = xcalloc_secure (1, sizeof *cfx.dek);
527
cfx.dek = xmalloc_secure_clear (sizeof *cfx.dek);
462
528
if( !opt.def_cipher_algo ) { /* try to get it from the prefs */
463
529
cfx.dek->algo = select_algo_from_prefs(pk_list,PREFTYPE_SYM,-1,NULL);
464
530
/* The only way select_algo_from_prefs can fail here is when
477
543
compliance_failure();
547
/* In case 3DES has been selected, print a warning if
548
any key does not have a preference for AES. This
549
should help to indentify why encrypting to several
550
recipients falls back to 3DES. */
552
&& cfx.dek->algo == CIPHER_ALGO_3DES)
553
warn_missing_aes_from_pklist (pk_list);
482
556
if(!opt.expert &&
483
557
select_algo_from_prefs(pk_list,PREFTYPE_SYM,
484
558
opt.def_cipher_algo,NULL)!=opt.def_cipher_algo)
485
log_info(_("forcing symmetric cipher %s (%d) "
486
"violates recipient preferences\n"),
487
gcry_cipher_algo_name (opt.def_cipher_algo),
559
log_info(_("WARNING: forcing symmetric cipher %s (%d)"
560
" violates recipient preferences\n"),
561
openpgp_cipher_algo_name (opt.def_cipher_algo),
488
562
opt.def_cipher_algo);
490
564
cfx.dek->algo = opt.def_cipher_algo;
493
567
cfx.dek->use_mdc=use_mdc(pk_list,cfx.dek->algo);
495
569
/* Only do the is-file-already-compressed check if we are using a
521
if (!opt.no_literal) {
522
/* setup the inner packet */
523
if( filename || opt.set_filename ) {
524
char *s = make_basename( opt.set_filename ? opt.set_filename
526
/* ,iobuf_get_real_fname( inp )*/ );
527
pt = xmalloc ( sizeof *pt + strlen(s) - 1 );
528
pt->namelen = strlen(s);
529
memcpy(pt->name, s, pt->namelen );
532
else { /* no filename */
533
pt = xmalloc ( sizeof *pt - 1 );
538
if (filename && *filename && !(*filename == '-' && !filename[1])
594
/* We put the passphrase (if any) after any public keys as this
595
seems to be the most useful on the recipient side - there is no
596
point in prompting a user for a passphrase if they have the
597
secret key needed to decrypt. */
598
if(use_symkey && (rc=write_symkey_enc(symkey_s2k,symkey_dek,cfx.dek,out)))
602
pt=setup_plaintext_name(filename,inp);
604
if (!iobuf_is_pipe_filename (filename) && *filename && !opt.textmode )
542
if ( !(tmpsize = iobuf_get_filelength(inp)) )
543
log_info(_("%s: WARNING: empty file\n"), filename );
609
if ( !(tmpsize = iobuf_get_filelength(inp, &overflow))
611
log_info(_("WARNING: `%s' is an empty file\n"), filename );
544
612
/* We can't encode the length of very large files because
545
613
OpenPGP uses only 32 bit for file sizes. So if the the
546
614
size of a file is larger than 2^32 minus some bytes for
547
615
packet headers, we switch to partial length encoding. */
548
if ( tmpsize < (IOBUF_FILELENGTH_LIMIT - 65536) )
616
if (tmpsize < (IOBUF_FILELENGTH_LIMIT - 65536) )
549
617
filesize = tmpsize;
554
filesize = opt.set_filesize ? opt.set_filesize : 0; /* stdin */
622
filesize = opt.set_filesize ? opt.set_filesize : 0; /* stdin */
556
624
if (!opt.no_literal) {
557
625
pt->timestamp = make_timestamp();
584
652
else if(!opt.expert &&
585
653
select_algo_from_prefs(pk_list,PREFTYPE_ZIP,
586
654
compr_algo,NULL)!=compr_algo)
587
log_info(_("forcing compression algorithm %s (%d) "
588
"violates recipient preferences\n"),
655
log_info(_("WARNING: forcing compression algorithm %s (%d)"
656
" violates recipient preferences\n"),
589
657
compress_algo_to_string(compr_algo),compr_algo);
591
659
/* algo 0 means no compression */
594
662
if (cfx.dek && cfx.dek->use_mdc)
596
zfx.algo = compr_algo;
597
iobuf_push_filter( out, compress_filter, &zfx );
664
push_compress_filter(out,&zfx,compr_algo);
601
668
/* do the work */
602
669
if (!opt.no_literal) {
603
670
if( (rc = build_packet( out, &pkt )) )
604
log_error("build_packet failed: %s\n", gpg_strerror (rc) );
671
log_error("build_packet failed: %s\n", g10_errstr(rc) );
607
674
/* user requested not to create a literal packet, so we copy
609
676
byte copy_buffer[4096];
610
677
int bytes_copied;
611
678
while ((bytes_copied = iobuf_read(inp, copy_buffer, 4096)) != -1)
612
if ((rc=iobuf_write(out, copy_buffer, bytes_copied))) {
613
log_error("copying input to output failed: %s\n",
679
if ( (rc=iobuf_write(out, copy_buffer, bytes_copied)) ) {
680
log_error ("copying input to output failed: %s\n",
617
684
wipememory(copy_buffer, 4096); /* burn buffer */
742
832
* algorithm number PK->PUBKEY_ALGO and pass it to pubkey_encrypt
743
833
* which returns the encrypted value in the array ENC->DATA.
744
834
* This array has a size which depends on the used algorithm
745
* (e.g. 2 for ElGamal). We don't need frame anymore because we
835
* (e.g. 2 for Elgamal). We don't need frame anymore because we
746
836
* have everything now in enc->data which is the passed to
749
frame = encode_session_key( dek, pubkey_nbits( pk->pubkey_algo,
751
rc = pk_encrypt( pk->pubkey_algo, enc->data, frame, pk->pkey );
752
gcry_mpi_release ( frame );
839
frame = encode_session_key (dek, pubkey_nbits (pk->pubkey_algo,
841
rc = pk_encrypt (pk->pubkey_algo, enc->data, frame, pk->pkey);
842
gcry_mpi_release (frame);
754
log_error("pubkey_encrypt failed: %s\n", gpg_strerror (rc) );
844
log_error ("pubkey_encrypt failed: %s\n", gpg_strerror (rc) );
756
846
if( opt.verbose ) {
757
char *ustr = get_user_id_string_printable (enc->keyid);
847
char *ustr = get_user_id_string_native (enc->keyid);
758
848
log_info(_("%s/%s encrypted for: \"%s\"\n"),
759
gcry_pk_algo_name (enc->pubkey_algo),
760
gcry_cipher_algo_name (dek->algo), ustr );
849
gcry_pk_algo_name (enc->pubkey_algo),
850
openpgp_cipher_algo_name (dek->algo),
763
854
/* and write it */
764
855
init_packet(&pkt);
801
892
line[strlen(line)-1] = '\0';
802
893
print_file_status(STATUS_FILE_START, line, 2);
803
if ( (rc = encode_crypt(line, remusr)) )
804
log_error("%s: encryption failed: %s\n",
805
print_fname_stdin(line), gpg_strerror (rc) );
894
if ( (rc = encode_crypt(line, remusr, 0)) )
895
log_error("encryption of `%s' failed: %s\n",
896
print_fname_stdin(line), g10_errstr(rc) );
806
897
write_status( STATUS_FILE_DONE );
813
904
print_file_status(STATUS_FILE_START, *files, 2);
814
if ( (rc = encode_crypt(*files, remusr)) )
815
log_error("%s: encryption failed: %s\n",
816
print_fname_stdin(*files), gpg_strerror (rc) );
905
if ( (rc = encode_crypt(*files, remusr, 0)) )
906
log_error("encryption of `%s' failed: %s\n",
907
print_fname_stdin(*files), g10_errstr(rc) );
817
908
write_status( STATUS_FILE_DONE );