diff options
author | Werner Koch <wk@gnupg.org> | 2008-08-29 15:40:24 +0000 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2008-08-29 15:40:24 +0000 |
commit | 936035b491fab2e32f651ed201bc10a6731ebe05 (patch) | |
tree | 0669310cd08811970b466f1308c37b63a0834602 /src/fips.c | |
parent | 78a1f612bf65d3c1a445c43b456cb28e98a3a6ea (diff) | |
download | libgcrypt-936035b491fab2e32f651ed201bc10a6731ebe05.tar.gz |
Overhauled the keygrip computation.
Diffstat (limited to 'src/fips.c')
-rw-r--r-- | src/fips.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -115,13 +115,14 @@ _gcry_initialize_fips_mode (int force) { FILE *fp; int saved_errno; + static const char const procfname[] = "/proc/sys/crypto/fips_enabled"; - fp = fopen ("/proc/fips140", "r"); + fp = fopen (procfname, "r"); if (fp) { char line[256]; - if (fgets (line, sizeof line, fp) && atoi (line) == 1) + if (fgets (line, sizeof line, fp) && atoi (line)) { /* System is in fips mode. */ fclose (fp); @@ -136,7 +137,7 @@ _gcry_initialize_fips_mode (int force) /* Problem reading the fips file despite that we have the proc file system. We better stop right away. */ log_info ("FATAL: error reading `%s' in libgcrypt: %s\n", - "/proc/fips140", strerror (saved_errno)); + procfname, strerror (saved_errno)); abort (); } } |