git: 42261492fa2f - main - security/p5-Crypt-OpenSSL-CA: Update to 0.91

From: Po-Chuan Hsieh <sunpoet_at_FreeBSD.org>
Date: Tue, 26 Apr 2022 15:07:02 UTC
The branch main has been updated by sunpoet:

URL: https://cgit.FreeBSD.org/ports/commit/?id=42261492fa2f03c6db67014ecab4c426f9d131e7

commit 42261492fa2f03c6db67014ecab4c426f9d131e7
Author:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
AuthorDate: 2022-04-26 14:56:58 +0000
Commit:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2022-04-26 15:01:48 +0000

    security/p5-Crypt-OpenSSL-CA: Update to 0.91
    
    Changes:        https://metacpan.org/dist/Crypt-OpenSSL-CA/changes
---
 security/p5-Crypt-OpenSSL-CA/Makefile              |  25 +-
 security/p5-Crypt-OpenSSL-CA/distinfo              |   5 +-
 .../files/patch-lib_Crypt_OpenSSL_CA.pm            | 320 ---------------------
 security/p5-Crypt-OpenSSL-CA/pkg-plist             |   2 +
 4 files changed, 14 insertions(+), 338 deletions(-)

diff --git a/security/p5-Crypt-OpenSSL-CA/Makefile b/security/p5-Crypt-OpenSSL-CA/Makefile
index 54b6611a0458..3b5d11592a3c 100644
--- a/security/p5-Crypt-OpenSSL-CA/Makefile
+++ b/security/p5-Crypt-OpenSSL-CA/Makefile
@@ -1,8 +1,7 @@
 # Created by: Mosconi <mosconi.rmg@gmail.com>
 
 PORTNAME=	Crypt-OpenSSL-CA
-PORTVERSION=	0.24
-PORTREVISION=	2
+PORTVERSION=	0.91
 CATEGORIES=	security perl5
 MASTER_SITES=	CPAN
 PKGNAMEPREFIX=	p5-
@@ -13,30 +12,24 @@ COMMENT=	Perl extension for OpenSSL CA API
 LICENSE=	ART10 GPLv1+
 LICENSE_COMB=	dual
 
-# Note: The Devel::Mallinfo dependency doesn't work on FreeBSD; mallinfo()
-# is a GNU libc function.
+# Note: Devel::Mallinfo is skipped because mallinfo() is a GNU libc function
 BUILD_DEPENDS=	${RUN_DEPENDS}
-RUN_DEPENDS=	p5-Convert-ASN1>=0.02:converters/p5-Convert-ASN1 \
+RUN_DEPENDS=	p5-Convert-ASN1>=0.20:converters/p5-Convert-ASN1 \
 		p5-Devel-Leak>=0:devel/p5-Devel-Leak \
 		p5-File-Slurp>=0:devel/p5-File-Slurp \
+		p5-File-Which>=0:sysutils/p5-File-Which \
 		p5-IPC-Run>=0:devel/p5-IPC-Run \
-		p5-Inline>=0.40:devel/p5-Inline \
 		p5-Inline-C>=0:devel/p5-Inline-C \
+		p5-Inline>=0.40:devel/p5-Inline \
 		p5-Net-SSLeay>=1.25:security/p5-Net-SSLeay
-TEST_DEPENDS=	p5-Test-Group>=0:devel/p5-Test-Group \
-		p5-Test-Taint>=0:devel/p5-Test-Taint
-
-BROKEN_SSL=	openssl
+TEST_DEPENDS=	p5-Test-Taint>=0:devel/p5-Test-Taint \
+		p5-Test2-Suite>=0:devel/p5-Test2-Suite
 
 USES=		perl5 ssl
 USE_PERL5=	modbuild
-CONFIGURE_ARGS=	--openssl-cflags=-L${OPENSSLINC} --openssl-ldflags="-I${OPENSSLLIB} ${OPENSSL_LDFLAGS}"
-
-.include <bsd.port.options.mk>
 
-.if ${OPSYS} == FreeBSD && (${SSL_DEFAULT} == base || ${SSL_DEFAULT} == openssl)
-BROKEN=		Does not support OpenSSL 1.1
-.endif
+CONFIGURE_ARGS=	--openssl-cflags=-L${OPENSSLINC} \
+		--openssl-ldflags="-I${OPENSSLLIB} ${OPENSSL_LDFLAGS}"
 
 post-install:
 	${STRIP_CMD} ${STAGEDIR}${PREFIX}/${SITE_ARCH_REL}/auto/Crypt/OpenSSL/CA/*/*.so
diff --git a/security/p5-Crypt-OpenSSL-CA/distinfo b/security/p5-Crypt-OpenSSL-CA/distinfo
index e27b4bf344aa..aaa23ff482aa 100644
--- a/security/p5-Crypt-OpenSSL-CA/distinfo
+++ b/security/p5-Crypt-OpenSSL-CA/distinfo
@@ -1,2 +1,3 @@
-SHA256 (Crypt-OpenSSL-CA-0.24.tar.gz) = 55b4f2549231be0e61cf685c4d89eefce9c19c636786c14cbd3428e976b3aa33
-SIZE (Crypt-OpenSSL-CA-0.24.tar.gz) = 140835
+TIMESTAMP = 1650970309
+SHA256 (Crypt-OpenSSL-CA-0.91.tar.gz) = b31ab4fcc4d9e1f608d8f1dabecd4ba24adde9f9b7342a5f7e90e8c51872b12f
+SIZE (Crypt-OpenSSL-CA-0.91.tar.gz) = 148722
diff --git a/security/p5-Crypt-OpenSSL-CA/files/patch-lib_Crypt_OpenSSL_CA.pm b/security/p5-Crypt-OpenSSL-CA/files/patch-lib_Crypt_OpenSSL_CA.pm
deleted file mode 100644
index 2e2be2f5d65b..000000000000
--- a/security/p5-Crypt-OpenSSL-CA/files/patch-lib_Crypt_OpenSSL_CA.pm
+++ /dev/null
@@ -1,320 +0,0 @@
---- lib/Crypt/OpenSSL/CA.pm.orig	2017-06-19 18:02:36 UTC
-+++ lib/Crypt/OpenSSL/CA.pm
-@@ -2064,6 +2064,43 @@ void DESTROY(SV* sv_self) {
- }
- X509_CRL_BASE
- 
-+
-+=head2 parse_CRL ($pem_crl)
-+
-+Creates and returns an I<Crypt::OpenSSL::CA::X509_CRL> object.
-+
-+=cut
-+
-+sub parse_CRL {
-+    my ($class, $pemcrl) = @_;
-+
-+    unless ($pemcrl) {
-+        croak("CRL pem must by");
-+    }
-+    return $class->_parse_CRL($pemcrl);
-+}
-+
-+
-+
-+use Crypt::OpenSSL::CA::Inline::C <<"_PARSE_CRL";
-+static
-+SV* _parse_CRL(char *class, const char* pemcrl) {
-+    BIO *crlbio;
-+    X509_CRL *crl = NULL;
-+
-+    crlbio = BIO_new_mem_buf((void *) pemcrl, -1);
-+    if (crlbio == NULL) {
-+        croak("BIO_new_mem_buf failed");
-+    }
-+    crl = PEM_read_bio_X509_CRL(crlbio, NULL, NULL, NULL);
-+    if (crl == NULL) {
-+            X509_CRL_free(crl);
-+            sslcroak("unable to parse CRL");
-+    }
-+    return perl_wrap("${\__PACKAGE__}", crl);
-+}
-+_PARSE_CRL
-+
- =head2 new ()
- 
- =head2 new ($version)
-@@ -2120,10 +2157,47 @@ void set_issuer_DN(SV* sv_self, SV* sv_dn) {
- }
- SET_ISSUER_DN
- 
-+=head2 get_issuer_DN()
-+
-+Get DN string of issuer the CRL
-+
-+=cut
-+
-+use Crypt::OpenSSL::CA::Inline::C <<"GET_ISSUER";
-+
-+static
-+SV* get_issuer_DN(SV* sv_self) {
-+    X509_CRL* self = perl_unwrap("${\__PACKAGE__}", X509_CRL *, sv_self);
-+    BIO* mem = BIO_new(BIO_s_mem());
-+    ASN1_TIME *next_update;
-+    X509_NAME *issuer = NULL;
-+
-+    if (! mem) {
-+        croak("Cannot allocate BIO");
-+    }
-+
-+    issuer = X509_NAME_new();
-+
-+    if (!(issuer = X509_CRL_get_issuer(self))) {
-+        sslcroak("X509_CRL_get_issuer failed");
-+    }
-+    if (!(X509_NAME_print_ex(mem, issuer, 0, XN_FLAG_ONELINE) && (BIO_write(mem, "\\0", 1) > 0))) {
-+            sslcroak("X509_CRL_get_nextUpdate failed");
-+    }
-+    return BIO_mem_to_SV(mem);
-+}
-+GET_ISSUER
-+
-+
- =head2 set_lastUpdate ($enddate)
- 
- =head2 set_nextUpdate ($startdate)
- 
-+=head2 get_nextUpdate ()
-+
-+=head2 get_lastUpdate ()
-+
-+
- Sets the validity period of the certificate.  The dates must be in the
- GMT timezone, with the format yyyymmddhhmmssZ (it's a literal Z at the
- end, meaning "Zulu" in case you care).
-@@ -2141,6 +2215,24 @@ void set_lastUpdate(SV* sv_self, char* startdate) {
- }
- 
- static
-+SV* get_lastUpdate(SV* sv_self) {
-+    X509_CRL* self = perl_unwrap("${\__PACKAGE__}", X509_CRL *, sv_self);
-+    BIO* mem = BIO_new(BIO_s_mem());
-+    ASN1_TIME *last_update;
-+
-+    if (! mem) {
-+        croak("Cannot allocate BIO");
-+    }
-+    if (!(last_update = X509_CRL_get_lastUpdate(self))) {
-+        sslcroak("X509_CRL_get_lastUpdate");
-+    }
-+    if (!(ASN1_TIME_print(mem, last_update) && (BIO_write(mem, "\\0", 1) > 0))) {
-+        sslcroak("X509_CRL_get_lastUpdate failed");
-+    }
-+    return BIO_mem_to_SV(mem);
-+}
-+
-+static
- void set_nextUpdate(SV* sv_self, char* enddate) {
-     ASN1_TIME* newtime;
-     X509_CRL* self = perl_unwrap("${\__PACKAGE__}", X509_CRL *, sv_self);
-@@ -2149,8 +2241,190 @@ void set_nextUpdate(SV* sv_self, char* enddate) {
-     X509_CRL_set_nextUpdate(self, time);
-     ASN1_TIME_free(time);
- }
-+
-+
-+static
-+SV* get_nextUpdate(SV* sv_self) {
-+    X509_CRL* self = perl_unwrap("${\__PACKAGE__}", X509_CRL *, sv_self);
-+    BIO* mem = BIO_new(BIO_s_mem());
-+    ASN1_TIME *next_update;
-+
-+    if (! mem) {
-+        croak("Cannot allocate BIO");
-+    }
-+    if (!(next_update = X509_CRL_get_nextUpdate(self))) {
-+        sslcroak("X509_CRL_get_nextUpdate");
-+    }
-+    if (!(ASN1_TIME_print(mem, next_update) && (BIO_write(mem, "\\0", 1) > 0))) {
-+        sslcroak("ASN1_TIME_print failed");
-+    }
-+    return BIO_mem_to_SV(mem);
-+}
- SET_UPDATES
- 
-+
-+
-+=head2 get_entryNumbers()
-+
-+Get array of revoked serial numbers.
-+
-+=cut
-+
-+use Crypt::OpenSSL::CA::Inline::C <<"GET_ENTRY_NUMBERS";
-+
-+static
-+SV* get_entryNumbers(SV* sv_self) {
-+    X509_CRL* self = perl_unwrap("${\__PACKAGE__}", X509_CRL *, sv_self);
-+    STACK_OF(X509_REVOKED) *rev = NULL;
-+    X509_REVOKED *rev_entry = NULL;
-+    int revnum, i;
-+
-+    if (!(rev = X509_CRL_get_REVOKED(self))) {
-+        sslcroak("X509_CRL_get_REVOKED failed");
-+    }
-+    if (!(revnum = sk_X509_REVOKED_num(rev))) {
-+        sslcroak("sk_X509_REVOKED_num failed");
-+    }
-+
-+    SV* serial_SV = NULL;
-+    SV* revokedate_SV = NULL;
-+    HV* hash = NULL;
-+    AV* array = newAV();
-+
-+    char* revokedate_label = "revokedate";
-+    char* serial_label = "serial";
-+
-+    BIO* mem = NULL;
-+    for(i = 0; i < revnum; i++) {
-+        if (!(hash = newHV())) {
-+            croak("Cannot allocate HV");
-+        }
-+
-+        if (!(rev_entry = sk_X509_REVOKED_value(rev, i))) {
-+            sslcroak("sk_X509_REVOKED_value failed");
-+        }
-+
-+        if (!(mem = BIO_new(BIO_s_mem()))) {
-+            croak("Cannot allocate BIO");
-+        }
-+        BIO_write(mem, "0x", 2);
-+        i2a_ASN1_INTEGER(mem, rev_entry->serialNumber);
-+        BIO_write(mem, "\\0", 1);
-+        serial_SV = BIO_mem_to_SV(mem);
-+        hv_store(hash, serial_label, strlen(serial_label), serial_SV, 0);
-+
-+        if (!(mem = BIO_new(BIO_s_mem()))) {
-+            croak("Cannot allocate BIO");
-+        }
-+        ASN1_TIME_print(mem, rev_entry->revocationDate);
-+        BIO_write(mem, "\\0", 1);
-+        revokedate_SV = BIO_mem_to_SV(mem);
-+        hv_store(hash, revokedate_label, strlen(revokedate_label), revokedate_SV, 0);
-+
-+        av_push(array, newRV_noinc((SV*)hash));
-+    }
-+    return newRV_noinc((SV*)array);
-+}
-+GET_ENTRY_NUMBERS
-+
-+=head2 get_entry_count()
-+
-+Get count of CRL entries.
-+
-+=cut
-+
-+use Crypt::OpenSSL::CA::Inline::C <<"GET_ENTRY_COUNT";
-+
-+int get_entry_count(SV* sv_self) {
-+    X509_CRL* self = perl_unwrap("${\__PACKAGE__}", X509_CRL *, sv_self);
-+    BIO* mem = BIO_new(BIO_s_mem());
-+    STACK_OF(X509_REVOKED) *rev = NULL;
-+    int count;
-+
-+    if (! mem) {
-+        croak("Cannot allocate BIO");
-+    }
-+    if (!(rev = X509_CRL_get_REVOKED(self))) {
-+        sslcroak("X509_CRL_get_REVOKED failed");
-+    }
-+    if (!(count = sk_X509_REVOKED_num(rev))) {
-+        sslcroak("sk_X509_REVOKED_num failed");
-+    }
-+    return count;
-+}
-+GET_ENTRY_COUNT
-+
-+
-+=head2 get_entry_revoke_date( $num )
-+
-+Get revoke date of entry in the CRL. Count begin from zero.
-+
-+=cut
-+
-+use Crypt::OpenSSL::CA::Inline::C <<"GET_ENTRY_REVOKE_DATE";
-+
-+static
-+SV* get_entry_revoke_date(SV* sv_self, int num) {
-+    X509_CRL* self = perl_unwrap("${\__PACKAGE__}", X509_CRL *, sv_self);
-+    BIO* mem = BIO_new(BIO_s_mem());
-+    ASN1_TIME *next_update;
-+    STACK_OF(X509_REVOKED) *rev = NULL;
-+    X509_REVOKED *rev_entry = NULL;
-+    int revnum, i;
-+
-+    if (! mem) {
-+        croak("Cannot allocate BIO");
-+    }
-+    if (!(rev = X509_CRL_get_REVOKED(self))) {
-+        sslcroak("X509_CRL_get_REVOKED failed");
-+    }
-+    if (!(rev_entry = sk_X509_REVOKED_value(rev, num))) {
-+            sslcroak("sk_X509_REVOKED_value failed");
-+    }
-+    ASN1_TIME_print(mem, rev_entry->revocationDate);
-+    if (!(BIO_write(mem, "\\0", 1) > 0)) {
-+        sslcroak("BIO_write failed");
-+    }
-+    return BIO_mem_to_SV(mem);
-+}
-+GET_ENTRY_REVOKE_DATE
-+
-+
-+=head2 get_entry_serial( $num )
-+
-+Get serial number of entry in the CRL.
-+
-+
-+=cut
-+
-+use Crypt::OpenSSL::CA::Inline::C <<"GET_ENTRY_SERIAL";
-+
-+static
-+SV* get_entry_serial(SV* sv_self, int num) {
-+    X509_CRL* self = perl_unwrap("${\__PACKAGE__}", X509_CRL *, sv_self);
-+    BIO* mem = BIO_new(BIO_s_mem());
-+    STACK_OF(X509_REVOKED) *rev = NULL;
-+    X509_REVOKED *rev_entry = NULL;
-+
-+    if (! mem) {
-+        croak("Cannot allocate BIO");
-+    }
-+    if (!(rev = X509_CRL_get_REVOKED(self))) {
-+        sslcroak("X509_CRL_get_REVOKED failed");
-+    }
-+    BIO_write(mem, "0x", 2); 
-+    if (!(rev_entry = sk_X509_REVOKED_value(rev, num))) {
-+            sslcroak("sk_X509_REVOKED_value failed");
-+    }
-+    i2a_ASN1_INTEGER(mem, rev_entry->serialNumber);
-+    if (!(BIO_write(mem, "\\0", 1) > 0)) {
-+        sslcroak("BIO_write failed");
-+    }
-+    return BIO_mem_to_SV(mem);
-+}
-+GET_ENTRY_SERIAL
-+
-+
- =head2 set_extension ($extname, $value, %options, %more_openssl_config)
- 
- =head2 add_extension ($extname, $value, %options, %more_openssl_config)
-@@ -2427,6 +2701,9 @@ Returns a textual representation of all the fields ins
- C<X509_CRL_print()>.
- 
- =cut
-+
-+
-+
- 
- use Crypt::OpenSSL::CA::Inline::C <<"DUMP";
- static
diff --git a/security/p5-Crypt-OpenSSL-CA/pkg-plist b/security/p5-Crypt-OpenSSL-CA/pkg-plist
index f14d0de73400..74a222e24c8d 100644
--- a/security/p5-Crypt-OpenSSL-CA/pkg-plist
+++ b/security/p5-Crypt-OpenSSL-CA/pkg-plist
@@ -2,6 +2,8 @@
 %%SITE_ARCH%%/Crypt/OpenSSL/CA/AlphabetSoup.pod
 %%SITE_ARCH%%/Crypt/OpenSSL/CA/Inline/C.pm
 %%SITE_ARCH%%/Crypt/OpenSSL/CA/Resources.pod
+%%SITE_ARCH%%/auto/Crypt/OpenSSL/CA/ASN1_INTEGER/ASN1_INTEGER.so
+%%SITE_ARCH%%/auto/Crypt/OpenSSL/CA/ASN1_TIME/ASN1_TIME.so
 %%SITE_ARCH%%/auto/Crypt/OpenSSL/CA/CONF/CONF.so
 %%SITE_ARCH%%/auto/Crypt/OpenSSL/CA/PrivateKey/PrivateKey.so
 %%SITE_ARCH%%/auto/Crypt/OpenSSL/CA/PublicKey/PublicKey.so