security/pks: unbreak the build against modern OpenSSL

Garbage-collect nowadays useless USE_GCC=yes while here.
This commit is contained in:
Alexey Dokuchaev 2023-02-23 10:06:50 +00:00
parent 0ce1876ac5
commit 6074b736de
2 changed files with 20 additions and 12 deletions

View file

@ -12,13 +12,7 @@ WWW= http://www.mit.edu/people/marc/pks/
LICENSE= BSD4CLAUSE
LICENSE_FILE= ${WRKSRC}/LICENSE
BROKEN_SSL= openssl
BROKEN_SSL_REASON_openssl= member access into incomplete type 'EVP_PKEY' (aka 'evp_pkey_st')
DEPRECATED= Broken with recent ssl
EXPIRATION_DATE= 2023-03-20
USES= bdb ssl
USE_GCC= yes
USE_RC_SUBR= pksd
WRKSRC= ${WRKDIR}/${PORTNAME}
@ -53,10 +47,4 @@ post-install-DOCS-on:
${MKDIR} ${STAGEDIR}${DOCSDIR}/
cd ${WRKSRC}/ && ${INSTALL_DATA} ${PORTDOCS} ${STAGEDIR}${DOCSDIR}/
.include <bsd.port.options.mk>
.if ${OPSYS} == FreeBSD && ${SSL_DEFAULT} == base
BROKEN= Does not build with OpenSSL 1.1
.endif
.include <bsd.port.mk>

View file

@ -0,0 +1,20 @@
--- pgputil.c.orig 2003-04-30 04:13:38 UTC
+++ pgputil.c
@@ -221,14 +221,14 @@ decode_x509 (ddesc * data, long len, ddesc * keyid)
{
return (0);
}
- switch (pkey->type)
+ switch (EVP_PKEY_type(EVP_PKEY_id(pkey)))
{
case EVP_PKEY_RSA:
/* pkey->pkey.rsa->n is the modulus */
- b = BN_dup (pkey->pkey.rsa->n);
+ b = BN_dup (RSA_get0_n(EVP_PKEY_get0_RSA(pkey)));
break;
case EVP_PKEY_DSA:
- b = BN_dup (pkey->pkey.dsa->p);
+ b = BN_dup (RSA_get0_p(EVP_PKEY_get0_DSA(pkey)));
break;
}
EVP_PKEY_free (pkey);