From b8cbc2c11369c1391832452e6ce0522c81bcf726 Mon Sep 17 00:00:00 2001 From: Iker Pedrosa Date: Thu, 6 May 2021 17:23:33 +0200 Subject: [PATCH] login.defs: include HMAC_CRYPTO_ALGO key Include the new HMAC_CRYPTO_ALGO key that is needed by pam_timestamp to select the algorithm that is going to be used to calculate the message authentication code. pam_timestamp is currently using an embedded algorithm to calculate the HMAC message, but the idea is to improve this behaviour by relying on openssl's implementation. On top of that, the ability to change the algorithm with a simple configuration change allows to simplify the process of removing unsecure algorithms. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1947294 --- etc/login.defs | 10 ++++++ lib/getdef.c | 1 + man/Makefile.am | 1 + man/login.defs.5.xml | 2 ++ man/login.defs.d/HMAC_CRYPTO_ALGO.xml | 44 +++++++++++++++++++++++++++ 5 files changed, 58 insertions(+) create mode 100644 man/login.defs.d/HMAC_CRYPTO_ALGO.xml diff --git a/etc/login.defs b/etc/login.defs index dbeffa64..94a2b1bc 100644 --- a/etc/login.defs +++ b/etc/login.defs @@ -467,3 +467,13 @@ USERGROUPS_ENAB yes # Set to "no" to not prevent for any account (dangerous, historical default) PREVENT_NO_AUTH superuser + +# +# Select the HMAC cryptography algorithm. +# Used in pam_timestamp module to calculate the keyed-hash message +# authentication code. +# +# Note: It is recommended to check hmac(3) to see the possible algorithms +# that are available in your system. +# +#HMAC_CRYPTO_ALGO SHA512 diff --git a/lib/getdef.c b/lib/getdef.c index eaf6b48f..b3472c65 100644 --- a/lib/getdef.c +++ b/lib/getdef.c @@ -61,6 +61,7 @@ struct itemdef { {"ENV_TZ", NULL}, \ {"FAILLOG_ENAB", NULL}, \ {"FTMP_FILE", NULL}, \ + {"HMAC_CRYPTO_ALGO", NULL}, \ {"ISSUE_FILE", NULL}, \ {"LASTLOG_ENAB", NULL}, \ {"LOGIN_STRING", NULL}, \ diff --git a/man/Makefile.am b/man/Makefile.am index 952a4f8b..f0f5c44b 100644 --- a/man/Makefile.am +++ b/man/Makefile.am @@ -136,6 +136,7 @@ login_defs_v = \ FAKE_SHELL.xml \ FTMP_FILE.xml \ GID_MAX.xml \ + HMAC_CRYPTO_ALGO.xml \ HOME_MODE.xml \ HUSHLOGIN_FILE.xml \ ISSUE_FILE.xml \ diff --git a/man/login.defs.5.xml b/man/login.defs.5.xml index bf6c976f..93178496 100644 --- a/man/login.defs.5.xml +++ b/man/login.defs.5.xml @@ -50,6 +50,7 @@ + @@ -187,6 +188,7 @@ &FAKE_SHELL; &FTMP_FILE; &GID_MAX; + &HMAC_CRYPTO_ALGO; &HOME_MODE; &HUSHLOGIN_FILE; &ISSUE_FILE; diff --git a/man/login.defs.d/HMAC_CRYPTO_ALGO.xml b/man/login.defs.d/HMAC_CRYPTO_ALGO.xml new file mode 100644 index 00000000..324ddab6 --- /dev/null +++ b/man/login.defs.d/HMAC_CRYPTO_ALGO.xml @@ -0,0 +1,44 @@ + + + (string) + + + Used to select the HMAC cryptography algorithm that the pam_timestamp + module is going to use to calculate the keyed-hash message authentication + code. + + + Note: Check hmac3 + to see the possible algorithms that are available in your system. + + +