Skip to content

Release 0.11 #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@ Revision history for Crypt-OpenSSL-SignCSR.

{{$NEXT}}

0.11 -- Tue Jul 18 19:27:54 ADT 2023

- daa5dd9 Increment version for release
- 3a09798 Remove undocumented sigopts from sign()
- 4295e6b Better regex for more openssl versions
- a32ff18 Find out the version of OpenSSL
- 2a21fa4 v0.10

0.10 -- Sat Jul 08 21:24:27 ADT 2023

- 7272fa3 Increment the version for a release
Expand Down
2 changes: 1 addition & 1 deletion Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ my %WriteMakefileArgs = (
"File::Slurper" => "0.012",
"File::Which" => 0
},
"VERSION" => "0.10",
"VERSION" => "0.11",
"test" => {
"TESTS" => "t/*.t"
}
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ my $signer = Crypt::OpenSSL::SignCSR->new(
format => $format, # Output format "text" or "pem" (default)
});
my $cert = $signer->sign(
$request, # CRS in PEM format
$request, # CSR in PEM format
);

my $ret = $signer->set_days(3650);
my $ret = $signer->set_format("text");
my $ret = $signer->set_days("SHA512");

$cert = $signer->sign( $request ); # CRS in PEM format
$cert = $signer->sign( $request ); # CSR in PEM format
```

# DESCRIPTION
Expand Down
7 changes: 3 additions & 4 deletions SignCSR.xs
Original file line number Diff line number Diff line change
Expand Up @@ -552,13 +552,12 @@ IV set_days(self, IV days)

RETVAL

SV * sign(self, request_SV, sigopts)
SV * sign(self, request_SV)
HV * self;
SV * request_SV;

PREINIT:
EVP_MD_CTX *mctx;
STACK_OF(OPENSSL_STRING) *sigopts = NULL;

CODE:

Expand Down Expand Up @@ -752,9 +751,9 @@ SV * sign(self, request_SV, sigopts)

// Sign the new certificate
#if OPENSSL_API_COMPAT >= 30101
if (mctx != NULL && do_sign_init(mctx, private_key, digestname, sigopts) > 0)
if (mctx != NULL && do_sign_init(mctx, private_key, digestname, NULL) > 0)
#else
if (mctx != NULL && do_sign_init(mctx, private_key, md, sigopts) > 0)
if (mctx != NULL && do_sign_init(mctx, private_key, md, NULL) > 0)
#endif
rv = (X509_sign_ctx(x, mctx) > 0);

Expand Down
6 changes: 3 additions & 3 deletions lib/Crypt/OpenSSL/SignCSR.pm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use warnings;

require Exporter;

our $VERSION = "0.10";
our $VERSION = "0.11";

our @ISA = qw(Exporter);

Expand Down Expand Up @@ -43,14 +43,14 @@ Crypt::OpenSSL::SignCSR - Sign a Certificate Signing Request in XS.
format => $format, # Output format "text" or "pem" (default)
});
my $cert = $signer->sign(
$request, # CRS in PEM format
$request, # CSR in PEM format
);

my $ret = $signer->set_days(3650);
my $ret = $signer->set_format("text");
my $ret = $signer->set_days("SHA512");

$cert = $signer->sign( $request ); # CRS in PEM format
$cert = $signer->sign( $request ); # CSR in PEM format

=head1 DESCRIPTION

Expand Down
4 changes: 2 additions & 2 deletions t/002-create-cert-from-csr.t
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ bczN2A==
-----END CERTIFICATE REQUEST-----
CERTREQUEST

my $cert = $signer->sign($request, '');
my $cert = $signer->sign($request);

my $certfile = tempfile();
my ($certfh, $certfilename) = tempfile();
Expand All @@ -85,7 +85,7 @@ eval {
$result = `$openssl x509 -in $certfilename -text`;
};

like($result, qr/Issuer: C = CA, O = XML::Sig, OU = perl/, "Certificate - Issuer OK");
like($result, qr/Issuer:.*XML::Sig.*perl/, "Certificate - Issuer OK");
like($result, qr/Signature Algorithm: sha512WithRSAEncryption/, "Certificate - Signature OK");

ok($signer->get_days() eq 365, "Days were set successfully");
Expand Down
4 changes: 2 additions & 2 deletions t/003-openssl-crypt-pkcs10.t
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ my $signer = Crypt::OpenSSL::SignCSR->new(

isa_ok($signer, "Crypt::OpenSSL::SignCSR");

my $cert = $signer->sign($request, '');
my $cert = $signer->sign($request);

my $certfile = tempfile();
my ($certfh, $certfilename) = tempfile();
Expand All @@ -88,7 +88,7 @@ eval {

unlink $certfilename;

like($result, qr/Issuer: C = CA, ST = New Brunswick, O = XML::Sig, OU = perl/, "Certificate - Issuer OK");
like($result, qr/Issuer:.*XML::Sig.*perl/, "Certificate - Issuer OK");
like($result, qr/Signature Algorithm: sha512WithRSAEncryption/, "Certificate - Signature OK");

done_testing