krb5 commit: Rename hmac() function

Greg Hudson <[email protected]>
Newsgroups gmane.comp.encryption.kerberos.cvs
Message-ID <[email protected]>
https://github.com/krb5/krb5/commit/e8b463c8d2c9b903d61c8646af3c0106808f906d
commit e8b463c8d2c9b903d61c8646af3c0106808f906d
Author: Thomas Klausner <[email protected]>
Date:   Mon May 6 16:03:38 2019 +0200

    Rename hmac() function
    
    NetBSD 8's stdlib.h declares a hmac() function; rename ours to avoid a
    conflict.
    
    [[email protected]: picked a different name and added a comment]
    
    ticket: 8803 (new)
    tags: pullup
    target_version: 1.17-next

 src/lib/crypto/builtin/pbkdf2.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/lib/crypto/builtin/pbkdf2.c b/src/lib/crypto/builtin/pbkdf2.c
index 8905f26..d1a0710 100644
--- a/src/lib/crypto/builtin/pbkdf2.c
+++ b/src/lib/crypto/builtin/pbkdf2.c
@@ -73,10 +73,12 @@ static void printd (const char *descr, krb5_data *d) {
  * Implements the hmac-sha1 PRF.  pass has been pre-hashed (if
  * necessary) and converted to a key already; salt has had the block
  * index appended to the original salt.
+ *
+ * NetBSD 8 declares an hmac() function in stdlib.h, so avoid that name.
  */
 static krb5_error_code
-hmac(const struct krb5_hash_provider *hash, krb5_keyblock *pass,
-     krb5_data *salt, krb5_data *out)
+k5_hmac(const struct krb5_hash_provider *hash, krb5_keyblock *pass,
+        krb5_data *salt, krb5_data *out)
 {
     krb5_error_code err;
     krb5_crypto_iov iov;
@@ -111,7 +113,7 @@ F(char *output, char *u_tmp1, char *u_tmp2,
 
     out = make_data(u_tmp1, hlen);
 
-    err = hmac(hash, pass, &sdata, &out);
+    err = k5_hmac(hash, pass, &sdata, &out);
     if (err)
         return err;
 
@@ -121,7 +123,7 @@ F(char *output, char *u_tmp1, char *u_tmp2,
     sdata.length = hlen;
     for (j = 2; j <= count; j++) {
         memcpy(u_tmp2, u_tmp1, hlen);
-        err = hmac(hash, pass, &sdata, &out);
+        err = k5_hmac(hash, pass, &sdata, &out);
         if (err)
             return err;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.