From: Steffan Karger <[email protected]> httpdigest.h defines IN as const, and never undefines it. This leaks into the pkcs11-helper headers that proxy.c includes later on, which use IN/OUT as empty annotations and only define them if not defined yet. That changes the pkcs11-helper declarations proxy.c sees ('IN void * const' becomes 'const void * const'), and makes clang spit out over a hundred -Wduplicate-decl-specifier warnings.
Just use const where we used IN, and drop OUT. No functional change. Change-Id: I2490a0780a6e7c98a270e97b415b0387093d37be Signed-off-by: Steffan Karger <[email protected]> Acked-by: Razvan Cojocaru <[email protected]> Acked-by: Arne Schwabe <[email protected]> Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2166 --- This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master. Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2166 This mail reflects revision 2 of this Change. Acked-by according to Gerrit (reflected above): Razvan Cojocaru <[email protected]> Arne Schwabe <[email protected]> diff --git a/src/openvpn/httpdigest.c b/src/openvpn/httpdigest.c index 52df383..9bfa074 100644 --- a/src/openvpn/httpdigest.c +++ b/src/openvpn/httpdigest.c @@ -32,7 +32,7 @@ #include "httpdigest.h" static void -CvtHex(IN HASH Bin, OUT HASHHEX Hex) +CvtHex(const HASH Bin, HASHHEX Hex) { for (unsigned short i = 0; i < HASHLEN; i++) { @@ -60,8 +60,8 @@ /* calculate H(A1) as per spec */ void -DigestCalcHA1(IN char *pszAlg, IN char *pszUserName, IN char *pszRealm, IN char *pszPassword, - IN char *pszNonce, IN char *pszCNonce, OUT HASHHEX SessionKey) +DigestCalcHA1(const char *pszAlg, const char *pszUserName, const char *pszRealm, const char *pszPassword, + const char *pszNonce, const char *pszCNonce, HASHHEX SessionKey) { HASH HA1; md_ctx_t *md5_ctx = md_ctx_new(); @@ -90,15 +90,15 @@ /* calculate request-digest/response-digest as per HTTP Digest spec */ void -DigestCalcResponse(IN HASHHEX HA1, /* H(A1) */ - IN char *pszNonce, /* nonce from server */ - IN char *pszNonceCount, /* 8 hex digits */ - IN char *pszCNonce, /* client nonce */ - IN char *pszQop, /* qop-value: "", "auth", "auth-int" */ - IN char *pszMethod, /* method from the request */ - IN char *pszDigestUri, /* requested URL */ - IN HASHHEX HEntity, /* H(entity body) if qop="auth-int" */ - OUT HASHHEX Response /* request-digest or response-digest */ +DigestCalcResponse(const HASHHEX HA1, /* H(A1) */ + const char *pszNonce, /* nonce from server */ + const char *pszNonceCount, /* 8 hex digits */ + const char *pszCNonce, /* client nonce */ + const char *pszQop, /* qop-value: "", "auth", "auth-int" */ + const char *pszMethod, /* method from the request */ + const char *pszDigestUri, /* requested URL */ + const HASHHEX HEntity, /* H(entity body) if qop="auth-int" */ + HASHHEX Response /* request-digest or response-digest */ ) { HASH HA2; diff --git a/src/openvpn/httpdigest.h b/src/openvpn/httpdigest.h index 9f3b075..37f3d98 100644 --- a/src/openvpn/httpdigest.h +++ b/src/openvpn/httpdigest.h @@ -26,25 +26,21 @@ typedef unsigned char HASH[HASHLEN]; #define HASHHEXLEN 32 typedef unsigned char HASHHEX[HASHHEXLEN + 1]; -#undef IN -#undef OUT -#define IN const -#define OUT /* calculate H(A1) as per HTTP Digest spec */ -void DigestCalcHA1(IN char *pszAlg, IN char *pszUserName, IN char *pszRealm, IN char *pszPassword, - IN char *pszNonce, IN char *pszCNonce, OUT HASHHEX SessionKey); +void DigestCalcHA1(const char *pszAlg, const char *pszUserName, const char *pszRealm, const char *pszPassword, + const char *pszNonce, const char *pszCNonce, HASHHEX SessionKey); /* calculate request-digest/response-digest as per HTTP Digest spec */ -void DigestCalcResponse(IN HASHHEX HA1, /* H(A1) */ - IN char *pszNonce, /* nonce from server */ - IN char *pszNonceCount, /* 8 hex digits */ - IN char *pszCNonce, /* client nonce */ - IN char *pszQop, /* qop-value: "", "auth", "auth-int" */ - IN char *pszMethod, /* method from the request */ - IN char *pszDigestUri, /* requested URL */ - IN HASHHEX HEntity, /* H(entity body) if qop="auth-int" */ - OUT HASHHEX Response /* request-digest or response-digest */ +void DigestCalcResponse(const HASHHEX HA1, /* H(A1) */ + const char *pszNonce, /* nonce from server */ + const char *pszNonceCount, /* 8 hex digits */ + const char *pszCNonce, /* client nonce */ + const char *pszQop, /* qop-value: "", "auth", "auth-int" */ + const char *pszMethod, /* method from the request */ + const char *pszDigestUri, /* requested URL */ + const HASHHEX HEntity, /* H(entity body) if qop="auth-int" */ + HASHHEX Response /* request-digest or response-digest */ ); #endif /* if PROXY_DIGEST_AUTH */ _______________________________________________ Openvpn-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openvpn-devel
