aboutsummaryrefslogtreecommitdiffstats
path: root/g10/sign.c
diff options
context:
space:
mode:
authorDavid Shaw <[email protected]>2006-04-20 02:36:05 +0000
committerDavid Shaw <[email protected]>2006-04-20 02:36:05 +0000
commit99b1f3e1da894b00006fff3ba601cc0ac2dd524d (patch)
tree5344e3174f6619a7c63c1f86c888884cd7bb7c7e /g10/sign.c
parent* sigs.test, mds.test: Add tests for SHA-224, SHA-384, and SHA-512. (diff)
downloadgnupg-99b1f3e1da894b00006fff3ba601cc0ac2dd524d.tar.gz
gnupg-99b1f3e1da894b00006fff3ba601cc0ac2dd524d.zip
* gpg.c (print_mds), armor.c (armor_filter, parse_hash_header): Add
SHA-224. * sign.c (write_plaintext_packet), encode.c (encode_simple): Factor common literal packet setup code from here, to... * main.h, plaintext.c (setup_plaintext_name): Here. New. Make sure the literal packet filename field is UTF-8 encoded. * options.h, gpg.c (main): Make sure --set-filename is UTF-8 encoded and note when filenames are already UTF-8.
Diffstat (limited to 'g10/sign.c')
-rw-r--r--g10/sign.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/g10/sign.c b/g10/sign.c
index c0ae6c1af..9552602a9 100644
--- a/g10/sign.c
+++ b/g10/sign.c
@@ -537,21 +537,8 @@ write_plaintext_packet (IOBUF out, IOBUF inp, const char *fname, int ptmode)
u32 filesize;
int rc = 0;
- if (!opt.no_literal) {
- if (fname || opt.set_filename) {
- char *s = make_basename (opt.set_filename? opt.set_filename
- : fname,
- iobuf_get_real_fname(inp));
- pt = xmalloc (sizeof *pt + strlen(s) - 1);
- pt->namelen = strlen (s);
- memcpy (pt->name, s, pt->namelen);
- xfree (s);
- }
- else { /* no filename */
- pt = xmalloc (sizeof *pt - 1);
- pt->namelen = 0;
- }
- }
+ if (!opt.no_literal)
+ pt=setup_plaintext_name(fname,inp);
/* try to calculate the length of the data */
if ( !iobuf_is_pipe_filename (fname) && *fname )