git://git.exim.org
/
exim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Debug: _exit() process-termination
[exim.git]
/
src
/
src
/
hash.h
diff --git
a/src/src/hash.h
b/src/src/hash.h
index d3531ccd9251ea438eecda202bd244de3fa6f3a4..5bd47acd1f14081ec64ecea688994ea869f42d8e 100644
(file)
--- a/
src/src/hash.h
+++ b/
src/src/hash.h
@@
-1,7
+1,7
@@
/*
* Exim - an Internet mail transport agent
*
/*
* Exim - an Internet mail transport agent
*
- * Copyright (C)
2016
Exim maintainers
+ * Copyright (C)
1995 - 2018
Exim maintainers
*
* Hash interface functions
*/
*
* Hash interface functions
*/
@@
-12,7
+12,6
@@
#define HASH_H
#include "sha_ver.h"
#define HASH_H
#include "sha_ver.h"
-#include "blob.h"
#ifdef SHA_OPENSSL
# include <openssl/sha.h>
#ifdef SHA_OPENSSL
# include <openssl/sha.h>
@@
-29,14
+28,33
@@
/* Hash context for the exim_sha_* routines */
/* Hash context for the exim_sha_* routines */
+typedef enum hashmethod {
+ HASH_BADTYPE,
+ HASH_NULL,
+ 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 {
typedef struct {
-
int sha1
;
- int hashlen;
+
hashmethod method
;
+ int
hashlen;
#ifdef SHA_OPENSSL
union {
SHA_CTX sha1; /* SHA1 block */
#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 */
+#ifdef EXIM_HAVE_SHA3
+ EVP_MD_CTX * mctx; /* SHA3 block */
+#endif
} u;
#elif defined(SHA_GNUTLS)
} u;
#elif defined(SHA_GNUTLS)
@@
-50,14
+68,16
@@
typedef struct {
sha1_context sha1; /* SHA1 block */
sha2_context sha2; /* SHA256 block */
} u;
sha1_context sha1; /* SHA1 block */
sha2_context sha2; /* SHA256 block */
} u;
+
+#elif defined(SHA_NATIVE)
+ sha1 sha1;
#endif
} hctx;
#endif
} 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 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 */
#endif
/* End of File */