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
ARC initial implementation. Experimental. Bug 2162
[exim.git]
/
src
/
src
/
pdkim
/
signing.c
diff --git
a/src/src/pdkim/signing.c
b/src/src/pdkim/signing.c
index b61b428327292cf6bad504a44bdf824b26e2245f..b182c9a209c0d730869cbb69ebc10fcc65864c9d 100644
(file)
--- a/
src/src/pdkim/signing.c
+++ b/
src/src/pdkim/signing.c
@@
-1,7
+1,7
@@
/*
* PDKIM - a RFC4871 (DKIM) implementation
*
/*
* PDKIM - a RFC4871 (DKIM) implementation
*
- * Copyright (C)
2017
Exim maintainers
+ * Copyright (C)
1995 - 2018
Exim maintainers
*
* signing/verification interface
*/
*
* signing/verification interface
*/
@@
-86,7
+86,7
@@
return string_cat(g, s);
Return: NULL for success, or an error string */
const uschar *
Return: NULL for success, or an error string */
const uschar *
-exim_dkim_signing_init(uschar * privkey_pem, es_ctx * sign_ctx)
+exim_dkim_signing_init(
const
uschar * privkey_pem, es_ctx * sign_ctx)
{
gnutls_datum_t k = { .data = privkey_pem, .size = Ustrlen(privkey_pem) };
gnutls_x509_privkey_t x509_key;
{
gnutls_datum_t k = { .data = privkey_pem, .size = Ustrlen(privkey_pem) };
gnutls_x509_privkey_t x509_key;
@@
-345,7
+345,7
@@
Only handles RSA keys.
Return: NULL for success, or an error string */
const uschar *
Return: NULL for success, or an error string */
const uschar *
-exim_dkim_signing_init(uschar * privkey_pem, es_ctx * sign_ctx)
+exim_dkim_signing_init(
const
uschar * privkey_pem, es_ctx * sign_ctx)
{
uschar * s1, * s2;
blob der;
{
uschar * s1, * s2;
blob der;
@@
-401,7
+401,7
@@
Useful cmds:
(not good for ed25519)
*/
(not good for ed25519)
*/
-
+
if ( !(s1 = Ustrstr(CS privkey_pem, "-----BEGIN RSA PRIVATE KEY-----"))
|| !(s2 = Ustrstr(CS (s1+=31), "-----END RSA PRIVATE KEY-----" ))
)
if ( !(s1 = Ustrstr(CS privkey_pem, "-----BEGIN RSA PRIVATE KEY-----"))
|| !(s2 = Ustrstr(CS (s1+=31), "-----END RSA PRIVATE KEY-----" ))
)
@@
-694,7
+694,7
@@
ERR_load_crypto_strings();
}
}
-/* accumulate data (was gnutls-onl but now needed for OpenSSL non-EC too
+/* accumulate data (was gnutls-onl
y
but now needed for OpenSSL non-EC too
because now using hash-and-sign interface) */
gstring *
exim_dkim_data_append(gstring * g, uschar * s)
because now using hash-and-sign interface) */
gstring *
exim_dkim_data_append(gstring * g, uschar * s)
@@
-707,7
+707,7
@@
return string_cat(g, s);
Return: NULL for success, or an error string */
const uschar *
Return: NULL for success, or an error string */
const uschar *
-exim_dkim_signing_init(uschar * privkey_pem, es_ctx * sign_ctx)
+exim_dkim_signing_init(
const
uschar * privkey_pem, es_ctx * sign_ctx)
{
BIO * bp = BIO_new_mem_buf(privkey_pem, -1);
{
BIO * bp = BIO_new_mem_buf(privkey_pem, -1);
@@
-752,10
+752,10
@@
if( (ctx = EVP_MD_CTX_create())
/* Initialise the DigestSign operation */
&& EVP_DigestSignInit(ctx, NULL, md, NULL, sign_ctx->key) > 0
/* Initialise the DigestSign operation */
&& EVP_DigestSignInit(ctx, NULL, md, NULL, sign_ctx->key) > 0
-
+
/* Call update with the message */
&& EVP_DigestSignUpdate(ctx, data->data, data->len) > 0
/* Call update with the message */
&& EVP_DigestSignUpdate(ctx, data->data, data->len) > 0
-
+
/* Finalise the DigestSign operation */
/* First call EVP_DigestSignFinal with a NULL sig parameter to obtain the length of the
* signature. Length is returned in slen */
/* Finalise the DigestSign operation */
/* First call EVP_DigestSignFinal with a NULL sig parameter to obtain the length of the
* signature. Length is returned in slen */