X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fsrc%2Fhash.h;h=337dc991063460fe35f9b4f0d898303c70f8638b;hb=eb00228301d5dd1607130d0a9f73c0cd1eba5db0;hp=89bedb926ebd804ee44d48f2f8f158231992564b;hpb=5fb822fc4839e253d2f839ba7966bc25a5329ac1;p=user%2Fhenk%2Fcode%2Fexim.git diff --git a/src/src/hash.h b/src/src/hash.h index 89bedb926..337dc9910 100644 --- a/src/src/hash.h +++ b/src/src/hash.h @@ -12,7 +12,6 @@ #define HASH_H #include "sha_ver.h" -#include "blob.h" #ifdef SHA_OPENSSL # include @@ -29,14 +28,29 @@ /* Hash context for the exim_sha_* routines */ +typedef enum hashmethod { + HASH_BADTYPE, + HASH_SHA1, + + HASH_SHA2_256, + HASH_SHA2_384, + HASH_SHA2_512, + + HASH_SHA3_224, + HASH_SHA3_256, + HASH_SHA3_384, + HASH_SHA3_512, +} hashmethod; + typedef struct { - BOOL is_sha1; - int hashlen; + hashmethod method; + int hashlen; #ifdef SHA_OPENSSL union { SHA_CTX sha1; /* SHA1 block */ - SHA256_CTX sha2; /* SHA256 block */ + SHA256_CTX sha2_256; /* SHA256 or 224 block */ + SHA512_CTX sha2_512; /* SHA512 or 384 block */ } u; #elif defined(SHA_GNUTLS) @@ -57,10 +71,9 @@ typedef struct { } hctx; -extern void exim_sha_init(hctx *, BOOL); +extern BOOL exim_sha_init(hctx *, hashmethod); extern void exim_sha_update(hctx *, const uschar *a, int); extern void exim_sha_finish(hctx *, blob *); -extern int exim_sha_hashlen(hctx *); #endif /* End of File */