diff options
author | NIIBE Yutaka <gniibe@fsij.org> | 2022-04-14 04:39:30 +0200 |
---|---|---|
committer | NIIBE Yutaka <gniibe@fsij.org> | 2022-04-14 04:46:58 +0200 |
commit | 5e508ffcab185eb8149e2fb2833ce15820140368 (patch) | |
tree | 03fbaebd525f2aa45865f5123039436d6f822741 /common/t-ssh-utils.c | |
parent | tests: Honor FIPS mode (diff) | |
download | gnupg2-5e508ffcab185eb8149e2fb2833ce15820140368.tar.xz gnupg2-5e508ffcab185eb8149e2fb2833ce15820140368.zip |
tests: Fix common/t-ssh-utils.
* common/t-ssh-utils.c (main): Accept an error with MD5 in_fips_mode.
--
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
Diffstat (limited to '')
-rw-r--r-- | common/t-ssh-utils.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/common/t-ssh-utils.c b/common/t-ssh-utils.c index 163d15733..debe70542 100644 --- a/common/t-ssh-utils.c +++ b/common/t-ssh-utils.c @@ -276,7 +276,7 @@ main (int argc, char **argv) int in_fips_mode = 0; gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0); - if (gcry_fips_mode_active()) + if (gcry_fips_mode_active ()) in_fips_mode = 1; /* --dump-keys dumps the keys as KEYGRIP.key.IDX. Useful to compute @@ -327,13 +327,17 @@ main (int argc, char **argv) xfree (string); err = ssh_get_fingerprint_string (key, GCRY_MD_MD5, &string); - if (in_fips_mode && !err) + if (in_fips_mode) { - fprintf (stderr, "%s:%d: Getting MD5 fingerprint unexpectedly " - "worked in FIPS mode\n", __FILE__, __LINE__); - exit (1); + if (!err) + { + fprintf (stderr, "%s:%d: Getting MD5 fingerprint unexpectedly " + "worked in FIPS mode\n", __FILE__, __LINE__); + exit (1); + } + continue; } - else if (err) + if (err) { fprintf (stderr, "%s:%d: error getting fingerprint: %s\n", __FILE__, __LINE__, gpg_strerror (err)); |