[Git][NTPsec/ntpsec][master] authreadkeys: add SHA-1 as an alias for SHA1

Hal Murray (@hal.murray) gitlab at mg.gitlab.com
Thu Nov 30 01:16:02 UTC 2023



Hal Murray pushed to branch master at NTPsec / ntpsec


Commits:
13122405 by Hal Murray at 2023-11-26T15:45:29-08:00
authreadkeys: add SHA-1 as an alias for SHA1

- - - - -


1 changed file:

- libntp/authreadkeys.c


Changes:

=====================================
libntp/authreadkeys.c
=====================================
@@ -98,6 +98,9 @@ try_cmac(const char *upcased, char* namebuf) {
 static char*
 try_digest(char *upcased, char *namebuf) {
 	strlcpy(namebuf, upcased, NAMEBUFSIZE);
+	if (strcmp(namebuf, "SHA-1") == 0) {
+		strlcpy(namebuf, "SHA1", NAMEBUFSIZE);
+	}
 	if (EVP_get_digestbyname(namebuf) != NULL) {
 	  return namebuf;
 	}
@@ -364,6 +367,7 @@ msyslog(LOG_ERR, "AUTH: authreadkeys: reading %s", file);
 		 * EVP_get_digestbyname() or EVP_get_cipherbyname().
 		 *
 		 * AES is short for AES-128.
+		 * SHA-1 is short for SHA1.
 		 * CMAC names get "-CBC" appended.
 		 * ntp classic uses AES128CMAC, so we support that too.
 		 *



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/-/commit/131224058f0b8e237eaecdf804e88a463cb8b2f4

-- 
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/-/commit/131224058f0b8e237eaecdf804e88a463cb8b2f4
You're receiving this email because of your account on gitlab.com.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20231130/d934950f/attachment-0001.htm>


More information about the vc mailing list