X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/acec9514b1006e352ef283f205ecec75a9b6ff0d..9aba085b920ab3b8cdd1085db917145785ca24cf:/src/src/pdkim/signing.h diff --git a/src/src/pdkim/signing.h b/src/src/pdkim/signing.h index 61e241e5d..ed6f397ce 100644 --- a/src/src/pdkim/signing.h +++ b/src/src/pdkim/signing.h @@ -1,7 +1,7 @@ /* * PDKIM - a RFC4871 (DKIM) implementation * - * Copyright (C) 2016 Exim maintainers + * Copyright (C) 1995 - 2020 Exim maintainers * * RSA signing/verification interface */ @@ -19,39 +19,53 @@ #elif defined(SIGN_GNUTLS) # include # include -# include +# include #elif defined(SIGN_GCRYPT) -# include -# include +# include +# include #endif #include "../blob.h" +typedef enum { + KEYTYPE_RSA, + KEYTYPE_ED25519 +} keytype; + +typedef enum { + KEYFMT_DER, /* an asn.1 structure */ + KEYFMT_ED25519_BARE /* just the key */ +} keyformat; + #ifdef SIGN_OPENSSL typedef struct { - EVP_PKEY * key; + keytype keytype; + EVP_PKEY * key; } es_ctx; typedef struct { - EVP_PKEY * key; + keytype keytype; + EVP_PKEY * key; } ev_ctx; #elif defined(SIGN_GNUTLS) typedef struct { - gnutls_x509_privkey_t key; + keytype keytype; + gnutls_privkey_t key; } es_ctx; typedef struct { + keytype keytype; gnutls_pubkey_t key; } ev_ctx; #elif defined(SIGN_GCRYPT) typedef struct { - int keytype; + keytype keytype; gcry_mpi_t n; gcry_mpi_t e; gcry_mpi_t d; @@ -63,7 +77,7 @@ typedef struct { } es_ctx; typedef struct { - int keytype; + keytype keytype; gcry_mpi_t n; gcry_mpi_t e; } ev_ctx; @@ -74,9 +88,9 @@ typedef struct { extern void exim_dkim_init(void); extern gstring * exim_dkim_data_append(gstring *, uschar *); -extern const uschar * exim_dkim_signing_init(uschar *, es_ctx *); +extern const uschar * exim_dkim_signing_init(const uschar *, es_ctx *); extern const uschar * exim_dkim_sign(es_ctx *, hashmethod, blob *, blob *); -extern const uschar * exim_dkim_verify_init(blob *, ev_ctx *); +extern const uschar * exim_dkim_verify_init(blob *, keyformat, ev_ctx *, unsigned *); extern const uschar * exim_dkim_verify(ev_ctx *, hashmethod, blob *, blob *); #endif /*DISABLE_DKIM*/