Skip to content

NetBSD: hmac() conflict with stdlib.h #476

Description

@moubctez

Building 1.20.3 on NetBSD gives error:

./../include/sha.h:314:12: error: conflicting types for 'hmac'; have 'int(SHAversion,  const unsigned char *, size_t,  const unsigned char *, size_t,  uint8_t *)' {aka 'int(SHAversion,  const unsigned char *, long unsigned int,  const unsigned char *, long unsigned int,  unsigned char *)'}
  314 | extern int hmac (SHAversion whichSha,   /* which SHA algorithm to use */
      |            ^~~~
In file included from login.c:41:
/usr/include/stdlib.h:309:10: note: previous declaration of 'hmac' with type 'ssize_t(const char *, const void *, size_t,  const void *, size_t,  void *, size_t)' {aka 'long int(const char *, const void *, long unsigned int,  const void *, long unsigned int,  void *, long unsigned int)'}
  309 | ssize_t  hmac(const char *, const void *, size_t, const void *, size_t, void *,
      |          ^~~~

From what I can see, hmac definition are not used and can be removed, solving the problem:

--- include/sha.h.orig	2026-08-07 07:44:14.462361966 +0000
+++ include/sha.h
@@ -305,6 +305,7 @@ extern int USHAHashSizeBits (enum SHAversion whichSha)
 extern int USHAHashSize (enum SHAversion whichSha);
 extern int USHAHashSizeBits (enum SHAversion whichSha);
 
+#if 0
 /*
  * HMAC Keyed-Hashing for Message Authentication, RFC2104,
  * for all SHAs.
@@ -330,5 +331,6 @@ extern int hmacResult (HMACContext * ctx, uint8_t *dig
 extern int hmacFinalBits (HMACContext * ctx, const uint8_t bits,
 			  size_t bitcount);
 extern int hmacResult (HMACContext * ctx, uint8_t *digest);
+#endif
 
 #endif /* _SHA_H_ */

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions