pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/mail/libdkim



Module Name:    pkgsrc
Committed By:   schmonz
Date:           Wed Jan 31 19:19:59 UTC 2024

Added Files:
        pkgsrc/mail/libdkim: DESCR Makefile PLIST distinfo
        pkgsrc/mail/libdkim/patches: patch-src_Makefile patch-src_dkimsign.cpp
            patch-src_dkimsign.h patch-src_dkimverify.cpp
            patch-src_dkimverify.h

Log Message:
Add libdkim: Portable library that signs and verifies emails

libdkim is a portable library that signs and verifies emails using the
OpenSSL library.

DomainKeys Identified Mail (DKIM) defines a domain-level authentication
framework for email using public-key cryptography and key server
technology to permit verification of the source and contents of messages
by either Mail Transport Agents (MTAs) or Mail User Agents (MUAs).


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 pkgsrc/mail/libdkim/DESCR pkgsrc/mail/libdkim/Makefile \
    pkgsrc/mail/libdkim/PLIST pkgsrc/mail/libdkim/distinfo
cvs rdiff -u -r0 -r1.1 pkgsrc/mail/libdkim/patches/patch-src_Makefile \
    pkgsrc/mail/libdkim/patches/patch-src_dkimsign.cpp \
    pkgsrc/mail/libdkim/patches/patch-src_dkimsign.h \
    pkgsrc/mail/libdkim/patches/patch-src_dkimverify.cpp \
    pkgsrc/mail/libdkim/patches/patch-src_dkimverify.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Added files:

Index: pkgsrc/mail/libdkim/DESCR
diff -u /dev/null pkgsrc/mail/libdkim/DESCR:1.1
--- /dev/null   Wed Jan 31 19:19:59 2024
+++ pkgsrc/mail/libdkim/DESCR   Wed Jan 31 19:19:58 2024
@@ -0,0 +1,7 @@
+libdkim is a portable library that signs and verifies emails using the
+OpenSSL library.
+
+DomainKeys Identified Mail (DKIM) defines a domain-level authentication
+framework for email using public-key cryptography and key server
+technology to permit verification of the source and contents of messages
+by either Mail Transport Agents (MTAs) or Mail User Agents (MUAs).
Index: pkgsrc/mail/libdkim/Makefile
diff -u /dev/null pkgsrc/mail/libdkim/Makefile:1.1
--- /dev/null   Wed Jan 31 19:19:59 2024
+++ pkgsrc/mail/libdkim/Makefile        Wed Jan 31 19:19:58 2024
@@ -0,0 +1,31 @@
+# $NetBSD: Makefile,v 1.1 2024/01/31 19:19:58 schmonz Exp $
+
+DISTNAME=              libdkim-1.0.21
+CATEGORIES=            mail
+MASTER_SITES=          ${MASTER_SITE_SOURCEFORGE:=libdkim/}
+EXTRACT_SUFX=          .zip
+
+MAINTAINER=            schmonz%NetBSD.org@localhost
+HOMEPAGE=              https://libdkim.sourceforge.net/
+COMMENT=               Portable library that signs and verifies emails
+LICENSE=               apache-2.0
+
+WRKSRC=                        ${WRKDIR}/${PKGBASE}
+BUILD_DIRS=            src
+NO_CONFIGURE=          yes
+USE_LANGUAGES=         c++
+USE_LIBTOOL=           yes
+
+MAKE_ENV+=             VERSION=${PKGVERSION_NOREV:Q}
+MAKE_ENV+=             LIBS=${LIBS:Q}
+LIBS+=                 -lssl -lcrypto
+CFLAGS+=               -I${BUILDLINK_PREFIX.openssl}/include
+LDFLAGS+=              -L${BUILDLINK_PREFIX.openssl}/lib
+LDFLAGS+=              ${COMPILER_RPATH_FLAG}${BUILDLINK_PREFIX.openssl}/lib
+CFLAGS.Darwin+=                -DBIND_8_COMPAT=1
+LIBS.Darwin+=          -lresolv
+
+INSTALLATION_DIRS=     include lib
+
+.include "../../security/openssl/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
Index: pkgsrc/mail/libdkim/PLIST
diff -u /dev/null pkgsrc/mail/libdkim/PLIST:1.1
--- /dev/null   Wed Jan 31 19:19:59 2024
+++ pkgsrc/mail/libdkim/PLIST   Wed Jan 31 19:19:58 2024
@@ -0,0 +1,3 @@
+@comment $NetBSD: PLIST,v 1.1 2024/01/31 19:19:58 schmonz Exp $
+include/dkim.h
+lib/libdkim.la
Index: pkgsrc/mail/libdkim/distinfo
diff -u /dev/null pkgsrc/mail/libdkim/distinfo:1.1
--- /dev/null   Wed Jan 31 19:19:59 2024
+++ pkgsrc/mail/libdkim/distinfo        Wed Jan 31 19:19:58 2024
@@ -0,0 +1,10 @@
+$NetBSD: distinfo,v 1.1 2024/01/31 19:19:58 schmonz Exp $
+
+BLAKE2s (libdkim-1.0.21.zip) = 4e8dbbac0b6347259ea9c0067abfbd6dda308e3896ef812b0741a0d5ce76e5ad
+SHA512 (libdkim-1.0.21.zip) = 3996c64398151dc9c07d357e8f3ac9b94e3c8d06ce5d83ebbe546416f361349d869b0b73216f28d0b732319731f31e61afd9eab0f540471760b944a90130a094
+Size (libdkim-1.0.21.zip) = 55049 bytes
+SHA1 (patch-src_Makefile) = 732f55924ef2d7cbd3a371493fe20fdee238de26
+SHA1 (patch-src_dkimsign.cpp) = cd2c52055bad9b2057186418af3a2446bb55eb51
+SHA1 (patch-src_dkimsign.h) = bd2754bf193a3b2118a8d473eb703aa908bab872
+SHA1 (patch-src_dkimverify.cpp) = 8c69a657ff1cfd5d65743fee9dd1cd619bbf6e16
+SHA1 (patch-src_dkimverify.h) = 583cca18d7cdeac52e8c9b99e6913d57b6cdde47

Index: pkgsrc/mail/libdkim/patches/patch-src_Makefile
diff -u /dev/null pkgsrc/mail/libdkim/patches/patch-src_Makefile:1.1
--- /dev/null   Wed Jan 31 19:19:59 2024
+++ pkgsrc/mail/libdkim/patches/patch-src_Makefile      Wed Jan 31 19:19:58 2024
@@ -0,0 +1,67 @@
+$NetBSD: patch-src_Makefile,v 1.1 2024/01/31 19:19:58 schmonz Exp $
+
+Libtoolize.
+
+--- src/Makefile.orig  2008-03-25 18:17:14.000000000 +0000
++++ src/Makefile
+@@ -1,41 +1,35 @@
+ # libdkim makefile for UNIX
+ #
+ 
+-#ifdef LINUX
+-CFLAGS  = -c
+-LFLAGS  = 
+-LIBS    = -lcrypto -lresolv
+-#else
+-CFLAGS  = -c
+-LFLAGS  = 
+-LIBS    = -lcrypto 
+-#endif
+-
+-INCL  =  -I /usr/include/openssl/
++LIBTOOL = libtool --tag=CXX
+ 
+ SRCS = dkim.cpp dns.cpp dkimbase.cpp dkimsign.cpp dkimverify.cpp
+ 
+-OBJS = $(SRCS:.cpp=.o)
++OBJS = $(SRCS:.cpp=.lo)
+ 
+ HDRS = dkim.h dns.h dkimbase.h dkimsign.h dkimverify.h
+ 
+-all: libdkim.a libdkimtest
++all: libdkim.la libdkimtest
++
++libdkim.la: libtool-version-info $(OBJS)
++      $(LIBTOOL) --mode=link g++ $(LDFLAGS) $(OBJS) -version-info `cat libtool-version-info` -rpath $(PREFIX)/lib -o $@
+ 
+-libdkim.a: $(OBJS)
+-      rm -f libdkim.a
+-      ar cr libdkim.a $(OBJS)
+-      ranlib libdkim.a
+-
+-libdkimtest : libdkim.a libdkimtest.o
+-      g++ -olibdkimtest $(LFLAGS) \
+-             -L . libdkimtest.o $(LIBS) -ldkim
++libdkimtest : libdkim.la libdkimtest.o
++      $(LIBTOOL) --mode=link g++ $(LDFLAGS) -ldkim $(LIBS) -o libdkimtest libdkimtest.o
+       
+-libdkimtest.o: libdkimtest.cpp $(HDRS)
++libdkimtest.lo: libdkimtest.cpp $(HDRS)
++      $(LIBTOOL) --mode=compile g++ $(CFLAGS) -c $<
+ 
+-.cpp.o:
+-      g++ $(CFLAGS) -c $<
++libtool-version-info:
++      echo $(VERSION) | awk -F. '{ printf "%d:%d:0", $$1, $$2 }' > $@
++
++.SUFFIXES: .lo
++.cpp.lo:
++      $(LIBTOOL) --mode=compile g++ $(CFLAGS) -c $<
+ 
+ clean:
+       rm  *.o libdkim.lib libdkimtest
+ 
+-
++install:
++      $(BSD_INSTALL_DATA) dkim.h $(DESTDIR)$(PREFIX)/include
++      $(LIBTOOL) --mode=install $(BSD_INSTALL_LIB) libdkim.la $(DESTDIR)$(PREFIX)/lib
Index: pkgsrc/mail/libdkim/patches/patch-src_dkimsign.cpp
diff -u /dev/null pkgsrc/mail/libdkim/patches/patch-src_dkimsign.cpp:1.1
--- /dev/null   Wed Jan 31 19:19:59 2024
+++ pkgsrc/mail/libdkim/patches/patch-src_dkimsign.cpp  Wed Jan 31 19:19:58 2024
@@ -0,0 +1,122 @@
+$NetBSD: patch-src_dkimsign.cpp,v 1.1 2024/01/31 19:19:58 schmonz Exp $
+
+Fix build with newer OpenSSL (from FreeBSD).
+
+--- src/dkimsign.cpp.orig      2024-01-30 15:33:54.094028460 +0000
++++ src/dkimsign.cpp
+@@ -41,20 +41,26 @@ CDKIMSign::CDKIMSign()
+       m_EmptyLineCount = 0;
+       m_pfnHdrCallback = NULL;
+ 
+-      EVP_SignInit( &m_allman_sha1ctx, EVP_sha1() );
+-      EVP_SignInit( &m_Hdr_ietf_sha1ctx, EVP_sha1() );
+-      EVP_SignInit( &m_Hdr_ietf_sha256ctx, EVP_sha256() );
+-      EVP_DigestInit( &m_Bdy_ietf_sha1ctx, EVP_sha1() );
+-      EVP_DigestInit( &m_Bdy_ietf_sha256ctx, EVP_sha256() );
++      m_allman_sha1ctx = EVP_MD_CTX_create();
++      m_Hdr_ietf_sha1ctx = EVP_MD_CTX_create();
++      m_Hdr_ietf_sha256ctx = EVP_MD_CTX_create();
++      m_Bdy_ietf_sha1ctx = EVP_MD_CTX_create();
++      m_Bdy_ietf_sha256ctx = EVP_MD_CTX_create();
++
++      EVP_SignInit( m_allman_sha1ctx, EVP_sha1() );
++      EVP_SignInit( m_Hdr_ietf_sha1ctx, EVP_sha1() );
++      EVP_SignInit( m_Hdr_ietf_sha256ctx, EVP_sha256() );
++      EVP_DigestInit( m_Bdy_ietf_sha1ctx, EVP_sha1() );
++      EVP_DigestInit( m_Bdy_ietf_sha256ctx, EVP_sha256() );
+ }
+ 
+ CDKIMSign::~CDKIMSign()
+ {
+-      EVP_MD_CTX_cleanup( &m_allman_sha1ctx );
+-      EVP_MD_CTX_cleanup( &m_Hdr_ietf_sha1ctx );
+-      EVP_MD_CTX_cleanup( &m_Hdr_ietf_sha256ctx );
+-      EVP_MD_CTX_cleanup( &m_Bdy_ietf_sha1ctx );
+-      EVP_MD_CTX_cleanup( &m_Bdy_ietf_sha256ctx );
++      EVP_MD_CTX_destroy( m_allman_sha1ctx );
++      EVP_MD_CTX_destroy( m_Hdr_ietf_sha1ctx );
++      EVP_MD_CTX_destroy( m_Hdr_ietf_sha256ctx );
++      EVP_MD_CTX_destroy( m_Bdy_ietf_sha1ctx );
++      EVP_MD_CTX_destroy( m_Bdy_ietf_sha256ctx );
+ }
+ 
+ ////////////////////////////////////////////////////////////////////////////////
+@@ -150,34 +156,34 @@ void CDKIMSign::Hash( const char* szBuff
+       {
+               if( m_nIncludeBodyHash & DKIM_BODYHASH_ALLMAN_1 )
+               {
+-                      EVP_SignUpdate( &m_allman_sha1ctx, szBuffer, nBufLength );
++                      EVP_SignUpdate( m_allman_sha1ctx, szBuffer, nBufLength );
+               }
+       }
+       else
+       {
+               if( m_nIncludeBodyHash < DKIM_BODYHASH_IETF_1 )
+               {
+-                      EVP_SignUpdate( &m_allman_sha1ctx, szBuffer, nBufLength );
++                      EVP_SignUpdate( m_allman_sha1ctx, szBuffer, nBufLength );
+               }
+               else if( m_nIncludeBodyHash & DKIM_BODYHASH_IETF_1 )
+               {
+                       if( m_nIncludeBodyHash & DKIM_BODYHASH_ALLMAN_1 )
+                       {
+-                              EVP_SignUpdate( &m_allman_sha1ctx, szBuffer, nBufLength );
++                              EVP_SignUpdate( m_allman_sha1ctx, szBuffer, nBufLength );
+                       }
+                       if( m_nHash & DKIM_HASH_SHA256 )
+                       {
+                               if( bHdr )
+-                                      EVP_SignUpdate( &m_Hdr_ietf_sha256ctx, szBuffer, nBufLength );
++                                      EVP_SignUpdate( m_Hdr_ietf_sha256ctx, szBuffer, nBufLength );
+                               else
+-                                      EVP_DigestUpdate( &m_Bdy_ietf_sha256ctx, szBuffer, nBufLength );
++                                      EVP_DigestUpdate( m_Bdy_ietf_sha256ctx, szBuffer, nBufLength );
+                       }
+                       if( m_nHash != DKIM_HASH_SHA256 )
+                       {
+                               if( bHdr )
+-                                      EVP_SignUpdate( &m_Hdr_ietf_sha1ctx, szBuffer, nBufLength );
++                                      EVP_SignUpdate( m_Hdr_ietf_sha1ctx, szBuffer, nBufLength );
+                               else
+-                                      EVP_DigestUpdate( &m_Bdy_ietf_sha1ctx, szBuffer, nBufLength );
++                                      EVP_DigestUpdate( m_Bdy_ietf_sha1ctx, szBuffer, nBufLength );
+                       }
+               }
+       }
+@@ -865,7 +871,7 @@ int CDKIMSign::ConstructSignature( char*
+               unsigned char Hash[EVP_MAX_MD_SIZE];
+               unsigned int nHashLen = 0;
+ 
+-              EVP_DigestFinal( bUseSha256 ? &m_Bdy_ietf_sha256ctx : &m_Bdy_ietf_sha1ctx, Hash, &nHashLen );
++              EVP_DigestFinal( bUseSha256 ? m_Bdy_ietf_sha256ctx : m_Bdy_ietf_sha1ctx, Hash, &nHashLen );
+ 
+               bio = BIO_new(BIO_s_mem());
+               if (!bio) {
+@@ -936,11 +942,11 @@ int CDKIMSign::ConstructSignature( char*
+ 
+       if( bUseIetfBodyHash )
+       {
+-              EVP_SignUpdate( bUseSha256 ? &m_Hdr_ietf_sha256ctx : &m_Hdr_ietf_sha1ctx, sTemp.c_str(), sTemp.size() );
++              EVP_SignUpdate( bUseSha256 ? m_Hdr_ietf_sha256ctx : m_Hdr_ietf_sha1ctx, sTemp.c_str(), sTemp.size() );
+       }
+       else
+       {
+-              EVP_SignUpdate( &m_allman_sha1ctx, sTemp.c_str(), sTemp.size() );
++              EVP_SignUpdate( m_allman_sha1ctx, sTemp.c_str(), sTemp.size() );
+       }
+  
+       bio = BIO_new_mem_buf(szPrivKey, -1);
+@@ -967,11 +973,11 @@ int CDKIMSign::ConstructSignature( char*
+       
+       if( bUseIetfBodyHash )
+       {
+-              nSignRet = EVP_SignFinal( bUseSha256 ? &m_Hdr_ietf_sha256ctx : &m_Hdr_ietf_sha1ctx, sig, &siglen, pkey);
++              nSignRet = EVP_SignFinal( bUseSha256 ? m_Hdr_ietf_sha256ctx : m_Hdr_ietf_sha1ctx, sig, &siglen, pkey);
+       }
+       else
+       {
+-              nSignRet = EVP_SignFinal( &m_allman_sha1ctx, sig, &siglen, pkey);
++              nSignRet = EVP_SignFinal( m_allman_sha1ctx, sig, &siglen, pkey);
+       }
+ 
+     EVP_PKEY_free(pkey);
Index: pkgsrc/mail/libdkim/patches/patch-src_dkimsign.h
diff -u /dev/null pkgsrc/mail/libdkim/patches/patch-src_dkimsign.h:1.1
--- /dev/null   Wed Jan 31 19:19:59 2024
+++ pkgsrc/mail/libdkim/patches/patch-src_dkimsign.h    Wed Jan 31 19:19:58 2024
@@ -0,0 +1,25 @@
+$NetBSD: patch-src_dkimsign.h,v 1.1 2024/01/31 19:19:58 schmonz Exp $
+
+Fix build with newer OpenSSL (from FreeBSD).
+
+--- src/dkimsign.h.orig        2024-01-30 15:32:51.926798884 +0000
++++ src/dkimsign.h
+@@ -60,13 +60,13 @@ protected:
+ 
+       int AssembleReturnedSig( char* szPrivKey );
+ 
+-      EVP_MD_CTX m_Hdr_ietf_sha1ctx;          /* the header hash for ietf sha1  */
+-      EVP_MD_CTX m_Hdr_ietf_sha256ctx;        /* the header hash for ietf sha256 */
++      EVP_MD_CTX *m_Hdr_ietf_sha1ctx;         /* the header hash for ietf sha1  */
++      EVP_MD_CTX *m_Hdr_ietf_sha256ctx;       /* the header hash for ietf sha256 */
+ 
+-      EVP_MD_CTX m_Bdy_ietf_sha1ctx;          /* the body hash for ietf sha1  */
+-      EVP_MD_CTX m_Bdy_ietf_sha256ctx;        /* the body hash for ietf sha256 */
++      EVP_MD_CTX *m_Bdy_ietf_sha1ctx;         /* the body hash for ietf sha1  */
++      EVP_MD_CTX *m_Bdy_ietf_sha256ctx;       /* the body hash for ietf sha256 */
+ 
+-      EVP_MD_CTX m_allman_sha1ctx;            /* the hash for allman sha1  */
++      EVP_MD_CTX *m_allman_sha1ctx;           /* the hash for allman sha1  */
+ 
+       int m_Canon;                            // canonization method
+ 
Index: pkgsrc/mail/libdkim/patches/patch-src_dkimverify.cpp
diff -u /dev/null pkgsrc/mail/libdkim/patches/patch-src_dkimverify.cpp:1.1
--- /dev/null   Wed Jan 31 19:19:59 2024
+++ pkgsrc/mail/libdkim/patches/patch-src_dkimverify.cpp        Wed Jan 31 19:19:58 2024
@@ -0,0 +1,98 @@
+$NetBSD: patch-src_dkimverify.cpp,v 1.1 2024/01/31 19:19:58 schmonz Exp $
+
+Fix build with newer OpenSSL (from FreeBSD).
+
+--- src/dkimverify.cpp.orig    2008-09-15 12:21:58.000000000 +0000
++++ src/dkimverify.cpp
+@@ -43,8 +43,10 @@ SignatureInfo::SignatureInfo(bool s)
+ {
+       VerifiedBodyCount = 0;
+       UnverifiedBodyCount = 0;
+-      EVP_MD_CTX_init( &m_Hdr_ctx );
+-      EVP_MD_CTX_init( &m_Bdy_ctx );
++      m_Hdr_ctx = EVP_MD_CTX_create();
++      m_Bdy_ctx = EVP_MD_CTX_create();
++      EVP_MD_CTX_init( m_Hdr_ctx );
++      EVP_MD_CTX_init( m_Bdy_ctx );
+       m_pSelector = NULL;
+       Status = DKIM_SUCCESS;
+       m_nHash = 0;
+@@ -54,8 +56,8 @@ SignatureInfo::SignatureInfo(bool s)
+ 
+ SignatureInfo::~SignatureInfo()
+ {
+-      EVP_MD_CTX_cleanup( &m_Hdr_ctx );
+-      EVP_MD_CTX_cleanup( &m_Bdy_ctx );
++      EVP_MD_CTX_destroy( m_Hdr_ctx );
++      EVP_MD_CTX_destroy( m_Bdy_ctx );
+ }
+ 
+ 
+@@ -210,7 +212,7 @@ void DecodeQuotedPrintable(char *ptr)
+ ////////////////////////////////////////////////////////////////////////////////
+ unsigned DecodeBase64(char *ptr)
+ {
+-      static const unsigned char base64_table[256] = {
++      static const int base64_table[256] = {
+               -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
+               -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-1,-1,-1,
+               -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,
+@@ -459,7 +461,7 @@ int CDKIMVerify::GetResults(void)
+                               unsigned char md[EVP_MAX_MD_SIZE];
+                               unsigned len = 0;
+ 
+-                              int res = EVP_DigestFinal( &i->m_Bdy_ctx, md, &len);
++                              int res = EVP_DigestFinal( i->m_Bdy_ctx, md, &len);
+ 
+                               if (!res || len != i->BodyHashData.length() || memcmp(i->BodyHashData.data(), md, len) != 0)
+                               {
+@@ -515,7 +517,7 @@ int CDKIMVerify::GetResults(void)
+ 
+                       assert( i->m_pSelector != NULL );
+ 
+-                      int res = EVP_VerifyFinal( &i->m_Hdr_ctx, (unsigned char *) i->SignatureData.data(), i->SignatureData.length(), i->m_pSelector->PublicKey);
++                      int res = EVP_VerifyFinal( i->m_Hdr_ctx, (unsigned char *) i->SignatureData.data(), i->SignatureData.length(), i->m_pSelector->PublicKey);
+ 
+                       if (res == 1)
+                       {
+@@ -658,11 +660,11 @@ void SignatureInfo::Hash( const char* sz
+ 
+       if (IsBody && !BodyHashData.empty())
+       {
+-              EVP_DigestUpdate( &m_Bdy_ctx, szBuffer, nBufLength );
++              EVP_DigestUpdate( m_Bdy_ctx, szBuffer, nBufLength );
+       }
+       else
+       {
+-              EVP_VerifyUpdate( &m_Hdr_ctx, szBuffer, nBufLength );
++              EVP_VerifyUpdate( m_Hdr_ctx, szBuffer, nBufLength );
+       }
+ 
+       if (m_SaveCanonicalizedData)
+@@ -741,13 +743,13 @@ int CDKIMVerify::ProcessHeaders(void)
+               // initialize the hashes
+               if (sig.m_nHash == DKIM_HASH_SHA256)
+               {
+-                      EVP_VerifyInit( &sig.m_Hdr_ctx, EVP_sha256() );
+-                      EVP_DigestInit( &sig.m_Bdy_ctx, EVP_sha256() );
++                      EVP_VerifyInit( sig.m_Hdr_ctx, EVP_sha256() );
++                      EVP_DigestInit( sig.m_Bdy_ctx, EVP_sha256() );
+               }
+               else
+               {
+-                      EVP_VerifyInit( &sig.m_Hdr_ctx, EVP_sha1() );
+-                      EVP_DigestInit( &sig.m_Bdy_ctx, EVP_sha1() );
++                      EVP_VerifyInit( sig.m_Hdr_ctx, EVP_sha1() );
++                      EVP_DigestInit( sig.m_Bdy_ctx, EVP_sha1() );
+               }
+ 
+               // compute the hash of the header
+@@ -1337,7 +1339,7 @@ int SelectorInfo::Parse( char* Buffer )
+                       return DKIM_SELECTOR_PUBLIC_KEY_INVALID;
+ 
+               // make sure public key is the correct type (we only support rsa)
+-              if (pkey->type == EVP_PKEY_RSA || pkey->type == EVP_PKEY_RSA2)
++              if (EVP_PKEY_id(pkey) == EVP_PKEY_RSA || EVP_PKEY_id(pkey) == EVP_PKEY_RSA2)
+               {
+                       PublicKey = pkey;
+               }
Index: pkgsrc/mail/libdkim/patches/patch-src_dkimverify.h
diff -u /dev/null pkgsrc/mail/libdkim/patches/patch-src_dkimverify.h:1.1
--- /dev/null   Wed Jan 31 19:19:59 2024
+++ pkgsrc/mail/libdkim/patches/patch-src_dkimverify.h  Wed Jan 31 19:19:58 2024
@@ -0,0 +1,17 @@
+$NetBSD: patch-src_dkimverify.h,v 1.1 2024/01/31 19:19:58 schmonz Exp $
+
+Fix build with newer OpenSSL (from FreeBSD).
+
+--- src/dkimverify.h.orig      2024-01-30 15:38:58.878663825 +0000
++++ src/dkimverify.h
+@@ -83,8 +83,8 @@ public:
+       unsigned VerifiedBodyCount;
+       unsigned UnverifiedBodyCount;
+ 
+-      EVP_MD_CTX m_Hdr_ctx;
+-      EVP_MD_CTX m_Bdy_ctx;
++      EVP_MD_CTX *m_Hdr_ctx;
++      EVP_MD_CTX *m_Bdy_ctx;
+       SelectorInfo *m_pSelector;
+ 
+       int Status;



Home | Main Index | Thread Index | Old Index