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
DKIM: reinstate embedded Polarssl SHA routines under older GnuTLS. Bug 1772
[exim.git]
/
src
/
src
/
pdkim
/
pdkim.h
diff --git
a/src/src/pdkim/pdkim.h
b/src/src/pdkim/pdkim.h
index c7c7b58377e14c5debf13ac6bf24b0b2625f1a38..97a03eabcb909147c0054ae00a2bba0d97756569 100644
(file)
--- a/
src/src/pdkim/pdkim.h
+++ b/
src/src/pdkim/pdkim.h
@@
-20,13
+20,6
@@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifdef USE_GNUTLS
-# include <gnutls/gnutls.h>
-# include <gnutls/crypto.h>
-#else
-# include <openssl/sha.h>
-#endif
-
/* -------------------------------------------------------------------------- */
/* Length of the preallocated buffer for the "answer" from the dns/txt
callback function. This should match the maximum RDLENGTH from DNS. */
/* -------------------------------------------------------------------------- */
/* Length of the preallocated buffer for the "answer" from the dns/txt
callback function. This should match the maximum RDLENGTH from DNS. */
@@
-74,6
+67,10
@@
/* Some required forward declarations, please ignore */
typedef struct pdkim_stringlist pdkim_stringlist;
typedef struct pdkim_str pdkim_str;
/* Some required forward declarations, please ignore */
typedef struct pdkim_stringlist pdkim_stringlist;
typedef struct pdkim_str pdkim_str;
+typedef struct sha1_context sha1_context;
+typedef struct sha2_context sha2_context;
+#define HAVE_SHA1_CONTEXT
+#define HAVE_SHA2_CONTEXT
/* -------------------------------------------------------------------------- */
/* Some concessions towards Redmond */
/* -------------------------------------------------------------------------- */
/* Some concessions towards Redmond */
@@
-228,14
+225,17
@@
typedef struct pdkim_signature {
/* Properties below this point are used internally only ------------- */
/* Per-signature helper variables ----------------------------------- */
/* Properties below this point are used internally only ------------- */
/* Per-signature helper variables ----------------------------------- */
-#ifdef USE_GNUTLS
+#ifdef SHA_OPENSSL
+ SHA_CTX sha1_body; /* SHA1 block */
+ SHA256_CTX sha2_body; /* SHA256 block */
+#elif defined(SHA_GNUTLS)
gnutls_hash_hd_t sha_body; /* Either SHA1 or SHA256 block */
gnutls_hash_hd_t sha_body; /* Either SHA1 or SHA256 block */
-#el
se
-
SHA_CTX sha1_body; /* SHA1 block
*/
-
SHA256_CTX sha2_body; /* SHA256 block
*/
+#el
if defined(SHA_POLARSSL)
+
sha1_context *sha1_body; /* SHA1 block
*/
+
sha2_context *sha2_body; /* SHA256 block
*/
#endif
unsigned long signed_body_bytes; /* How many body bytes we hashed */
#endif
unsigned long signed_body_bytes; /* How many body bytes we hashed */
- pdkim_stringlist *headers;
/* Raw headers included in the sig
*/
+ pdkim_stringlist *headers;
/* Raw headers included in the sig
*/
/* Signing specific ------------------------------------------------- */
char *rsa_privkey; /* Private RSA key */
char *sign_headers; /* To-be-signed header names */
/* Signing specific ------------------------------------------------- */
char *rsa_privkey; /* Private RSA key */
char *sign_headers; /* To-be-signed header names */