diff options
author | Werner Koch <[email protected]> | 2010-12-02 15:49:02 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2010-12-02 15:49:02 +0000 |
commit | fcb5f7d08f25a2ca962b1f9ad7dbb332cc241f38 (patch) | |
tree | 19982dc1f1c8a0c4a88ca4e06974d70fc47caad9 /common | |
parent | Describe new log facilities. (diff) | |
download | gnupg-fcb5f7d08f25a2ca962b1f9ad7dbb332cc241f38.tar.gz gnupg-fcb5f7d08f25a2ca962b1f9ad7dbb332cc241f38.zip |
s/AES/AES128/ in diagnostics and --list-config
Diffstat (limited to 'common')
-rw-r--r-- | common/ChangeLog | 3 | ||||
-rw-r--r-- | common/audit.c | 6 | ||||
-rw-r--r-- | common/miscellaneous.c | 17 | ||||
-rw-r--r-- | common/util.h | 3 |
4 files changed, 26 insertions, 3 deletions
diff --git a/common/ChangeLog b/common/ChangeLog index 8d03e35db..5b4f1074c 100644 --- a/common/ChangeLog +++ b/common/ChangeLog @@ -1,5 +1,8 @@ 2010-12-02 Werner Koch <[email protected]> + * miscellaneous.c (gnupg_cipher_algo_name): New. Replace all + users of gcry_cipher_algo_name by this one. + * logging.c (fun_cookie_s) [W32CE]: Add field USE_WRITEFILE. (fun_writer) [W32CE]: Make use of it. (set_file_fd) [W32CE]: Implement special filename "GPG2:". diff --git a/common/audit.c b/common/audit.c index 02a0a2b22..38d0c0c3d 100644 --- a/common/audit.c +++ b/common/audit.c @@ -769,7 +769,7 @@ proc_type_encrypt (audit_ctx_t ctx) { algo = gcry_cipher_map_name (item->string); if (algo) - writeout_rem (ctx, _("algorithm: %s"), gcry_cipher_algo_name (algo)); + writeout_rem (ctx, _("algorithm: %s"), gnupg_cipher_algo_name (algo)); else if (item->string && !strcmp (item->string, "1.2.840.113549.3.2")) writeout_rem (ctx, _("unsupported algorithm: %s"), "RC2"); else if (item->string) @@ -909,14 +909,14 @@ proc_type_decrypt (audit_ctx_t ctx) algo = item? item->intvalue : 0; writeout_li (ctx, algo?"Yes":"No", "%s", _("Encryption algorithm supported")); if (algo) - writeout_rem (ctx, _("algorithm: %s"), gcry_cipher_algo_name (algo)); + writeout_rem (ctx, _("algorithm: %s"), gnupg_cipher_algo_name (algo)); item = find_log_item (ctx, AUDIT_BAD_DATA_CIPHER_ALGO, 0); if (item && item->string) { algo = gcry_cipher_map_name (item->string); if (algo) - writeout_rem (ctx, _("algorithm: %s"), gcry_cipher_algo_name (algo)); + writeout_rem (ctx, _("algorithm: %s"), gnupg_cipher_algo_name (algo)); else if (item->string && !strcmp (item->string, "1.2.840.113549.3.2")) writeout_rem (ctx, _("unsupported algorithm: %s"), "RC2"); else if (item->string) diff --git a/common/miscellaneous.c b/common/miscellaneous.c index fe065e653..0ff7d98d7 100644 --- a/common/miscellaneous.c +++ b/common/miscellaneous.c @@ -95,6 +95,23 @@ setup_libgcrypt_logging (void) gcry_set_outofcore_handler (my_gcry_outofcore_handler, NULL); } +/* A wrapper around gcry_cipher_algo_name to return the string + "AES-128" instead of "AES". Given that we have an alias in + libgcrypt for it, it does not harm to too much to return this other + string. Some users complained that we print "AES" but "AES192" + and "AES256". We can't fix that in libgcrypt but it is pretty + safe to do it in an application. */ +const char * +gnupg_cipher_algo_name (int algo) +{ + const char *s; + + s = gcry_cipher_algo_name (algo); + if (!strcmp (s, "AES")) + s = "AES128"; + return s; +} + /* Decide whether the filename is stdout or a real filename and return * an appropriate string. */ diff --git a/common/util.h b/common/util.h index 10fac88f2..7c58b15c5 100644 --- a/common/util.h +++ b/common/util.h @@ -255,6 +255,9 @@ char *xasprintf (const char *fmt, ...) JNLIB_GCC_A_PRINTF(1,2); /* This is now an alias to estream_asprintf. */ char *xtryasprintf (const char *fmt, ...) JNLIB_GCC_A_PRINTF(1,2); +/* Replacement for gcry_cipher_algo_name. */ +const char *gnupg_cipher_algo_name (int algo); + const char *print_fname_stdout (const char *s); const char *print_fname_stdin (const char *s); void print_utf8_buffer2 (estream_t fp, const void *p, size_t n, int delim); |