X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/7b83389d47d53105c1c52b551033706b3d62e744..5903c6ff59527362e869fedb565c56935ce8dd68:/src/src/hash.c diff --git a/src/src/hash.c b/src/src/hash.c index 059e6d9bb..f49add29c 100644 --- a/src/src/hash.c +++ b/src/src/hash.c @@ -25,7 +25,7 @@ typedef struct sha1 { sha1; #endif /*STAND_ALONE*/ - +#include /******************************************************************************/ #ifdef SHA_OPENSSL @@ -50,6 +50,9 @@ switch (h->method) { case HASH_SHA1: SHA1_Update (&h->u.sha1, data, len); break; case HASH_SHA256: SHA256_Update(&h->u.sha2, data, len); break; + /* should be blocked by init not handling these, but be explicit to + guard against accidents later (and hush up clang -Wswitch) */ + default: assert(0); } } @@ -62,6 +65,7 @@ switch (h->method) { case HASH_SHA1: SHA1_Final (b->data, &h->u.sha1); break; case HASH_SHA256: SHA256_Final(b->data, &h->u.sha2); break; + default: assert(0); } } @@ -772,7 +776,7 @@ int main(void) sha1 base; int j; int i = 0x01020304; -uschar *ctest = (uschar *)(&i); +uschar *ctest = US (&i); uschar buffer[256]; uschar digest[20]; uschar s[41];