--- b/Makefile 2019-04-03 10:44:44.000000000 +0200 +++ b/Makefile 2019-05-05 17:55:44.598933000 +0200 @@ -58,9 +58,8 @@ .include -.if ${SSL_DEFAULT} == base -BROKEN_FreeBSD_12= error: variable has incomplete type 'HMAC_CTX' (aka 'struct hmac_ctx_st') -BROKEN_FreeBSD_13= error: variable has incomplete type 'HMAC_CTX' (aka 'struct hmac_ctx_st') +.if ${OPSYS} == FreeBSD && ${OSVERSION} >= 1200030 +EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-spamd_sync.c .endif do-install: --- b/files/extra-patch-spamd_sync.c 1970-01-01 01:00:00.000000000 +0100 +++ b/files/extra-patch-spamd_sync.c 2019-05-05 17:41:34.012103000 +0200 @@ -0,0 +1,136 @@ +--- spamd/sync.c.orig 2019-05-05 15:29:42 UTC ++++ spamd/sync.c +@@ -439,7 +439,7 @@ sync_update(time_t now, char *helo, char *ip, char *fr + u_int16_t sglen, fromlen, tolen, helolen, padlen; + char pad[SPAM_ALIGNBYTES]; + int i = 0; +- HMAC_CTX ctx; ++ HMAC_CTX *ctx = HMAC_CTX_new(); + u_int hmac_len; + + if (debug) +@@ -455,8 +455,7 @@ sync_update(time_t now, char *helo, char *ip, char *fr + tolen = strlen(to) + 1; + helolen = strlen(helo) + 1; + +- HMAC_CTX_init(&ctx); +- HMAC_Init(&ctx, sync_key, strlen(sync_key), EVP_sha1()); ++ HMAC_Init_ex(ctx, sync_key, strlen(sync_key), EVP_sha1(), NULL); + + sglen = sizeof(sg) + fromlen + tolen + helolen; + padlen = SPAM_ALIGN(sglen) - sglen; +@@ -468,7 +467,7 @@ sync_update(time_t now, char *helo, char *ip, char *fr + hdr.sh_length = htons(sizeof(hdr) + sglen + padlen + sizeof(end)); + iov[i].iov_base = &hdr; + iov[i].iov_len = sizeof(hdr); +- HMAC_Update(&ctx, iov[i].iov_base, iov[i].iov_len); ++ HMAC_Update(ctx, iov[i].iov_base, iov[i].iov_len); + i++; + + /* Add single SPAM sync greylisting entry */ +@@ -481,27 +480,27 @@ sync_update(time_t now, char *helo, char *ip, char *fr + sg.sg_helo_length = htons(helolen); + iov[i].iov_base = &sg; + iov[i].iov_len = sizeof(sg); +- HMAC_Update(&ctx, iov[i].iov_base, iov[i].iov_len); ++ HMAC_Update(ctx, iov[i].iov_base, iov[i].iov_len); + i++; + + iov[i].iov_base = from; + iov[i].iov_len = fromlen; +- HMAC_Update(&ctx, iov[i].iov_base, iov[i].iov_len); ++ HMAC_Update(ctx, iov[i].iov_base, iov[i].iov_len); + i++; + + iov[i].iov_base = to; + iov[i].iov_len = tolen; +- HMAC_Update(&ctx, iov[i].iov_base, iov[i].iov_len); ++ HMAC_Update(ctx, iov[i].iov_base, iov[i].iov_len); + i++; + + iov[i].iov_base = helo; + iov[i].iov_len = helolen; +- HMAC_Update(&ctx, iov[i].iov_base, iov[i].iov_len); ++ HMAC_Update(ctx, iov[i].iov_base, iov[i].iov_len); + i++; + + iov[i].iov_base = pad; + iov[i].iov_len = padlen; +- HMAC_Update(&ctx, iov[i].iov_base, iov[i].iov_len); ++ HMAC_Update(ctx, iov[i].iov_base, iov[i].iov_len); + i++; + + /* Add end marker */ +@@ -509,14 +508,14 @@ sync_update(time_t now, char *helo, char *ip, char *fr + end.st_length = htons(sizeof(end)); + iov[i].iov_base = &end; + iov[i].iov_len = sizeof(end); +- HMAC_Update(&ctx, iov[i].iov_base, iov[i].iov_len); ++ HMAC_Update(ctx, iov[i].iov_base, iov[i].iov_len); + i++; + +- HMAC_Final(&ctx, hdr.sh_hmac, &hmac_len); ++ HMAC_Final(ctx, hdr.sh_hmac, &hmac_len); + + /* Send message to the target hosts */ + sync_send(iov, i); +- HMAC_CTX_cleanup(&ctx); ++ HMAC_CTX_free(ctx); + } + + void +@@ -527,7 +526,7 @@ sync_addr(time_t now, time_t expire, char *ip, u_int16 + struct spam_synctlv_addr sd; + struct spam_synctlv_hdr end; + int i = 0; +- HMAC_CTX ctx; ++ HMAC_CTX *ctx = HMAC_CTX_new(); + u_int hmac_len; + + if (debug) +@@ -537,8 +536,7 @@ sync_addr(time_t now, time_t expire, char *ip, u_int16 + bzero(&hdr, sizeof(hdr)); + bzero(&sd, sizeof(sd)); + +- HMAC_CTX_init(&ctx); +- HMAC_Init(&ctx, sync_key, strlen(sync_key), EVP_sha1()); ++ HMAC_Init_ex(ctx, sync_key, strlen(sync_key), EVP_sha1(), NULL); + + /* Add SPAM sync packet header */ + hdr.sh_version = SPAM_SYNC_VERSION; +@@ -547,7 +545,7 @@ sync_addr(time_t now, time_t expire, char *ip, u_int16 + hdr.sh_length = htons(sizeof(hdr) + sizeof(sd) + sizeof(end)); + iov[i].iov_base = &hdr; + iov[i].iov_len = sizeof(hdr); +- HMAC_Update(&ctx, iov[i].iov_base, iov[i].iov_len); ++ HMAC_Update(ctx, iov[i].iov_base, iov[i].iov_len); + i++; + + /* Add single SPAM sync address entry */ +@@ -558,7 +556,7 @@ sync_addr(time_t now, time_t expire, char *ip, u_int16 + sd.sd_ip = inet_addr(ip); + iov[i].iov_base = &sd; + iov[i].iov_len = sizeof(sd); +- HMAC_Update(&ctx, iov[i].iov_base, iov[i].iov_len); ++ HMAC_Update(ctx, iov[i].iov_base, iov[i].iov_len); + i++; + + /* Add end marker */ +@@ -566,14 +564,14 @@ sync_addr(time_t now, time_t expire, char *ip, u_int16 + end.st_length = htons(sizeof(end)); + iov[i].iov_base = &end; + iov[i].iov_len = sizeof(end); +- HMAC_Update(&ctx, iov[i].iov_base, iov[i].iov_len); ++ HMAC_Update(ctx, iov[i].iov_base, iov[i].iov_len); + i++; + +- HMAC_Final(&ctx, hdr.sh_hmac, &hmac_len); ++ HMAC_Final(ctx, hdr.sh_hmac, &hmac_len); + + /* Send message to the target hosts */ + sync_send(iov, i); +- HMAC_CTX_cleanup(&ctx); ++ HMAC_CTX_free(ctx); + } + + void --- b/files/pkg-message.in 2014-01-22 16:52:06.000000000 +0100 +++ b/files/pkg-message.in 2019-05-05 17:58:51.222380000 +0200 @@ -33,6 +33,6 @@ FreeBSD only features (not in OpenBSD): - sync for spamdb (parameter -Y) - See %%PREFIX%%/%%DOCSDIR%%/ for usage. + See %%DOCSDIR%%/ for usage. **********************************************************************