Skip Menu |

This queue is for tickets about the Crypt-OpenSSL-PKCS10 CPAN distribution.

Report information
The Basics
Id: 87049
Status: resolved
Priority: 0/
Queue: Crypt-OpenSSL-PKCS10

People
Owner: Nobody in particular
Requestors: ppisar [...] redhat.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.09
Fixed in: (no value)



Subject: Test crash due to undefined add_custom_ext_raw OID
$ make test PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/Mytest.t .. 1/5 Name "main::oid" used only once: possible typo at t/Mytest.t line 38. Show quoted text
-----BEGIN CERTIFICATE REQUEST----- MIG0MIGpAgEAMAAwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMIU1KHYmLMP RZyPG7wUCjwIbnHZKP43BUnP/O0an9q+9oElwuv4yfVcdPFYN1ANFyE0RIs4hQgz 1sqlfB4HUhtETeAb47uj2GiftN14VNo2l+kJ0CoQPtB0eGpTupSXcPsTwMOqCGNn gG5cO3m6Nlz0DxGeJiODhPdFaWgEsXyxAgMBAAGgADADBgEAAwEA -----END CERTIFICATE REQUEST----- -----BEGIN CERTIFICATE REQUEST----- MIG0MIGpAgEAMAAwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAM/VlujCZxwn VNUzEVEKVUz4XcMcw66hgJZREiD4BrXHBvGgSrBn+UcHLc6680dExErr9YhwxV2A q33W+88LboTE+l0hFJVeoq23YqUp3/sxskK/8ZgI199uyDuzE9QtLFE6PhIqArKJ 4k6oPCvAqJM+tewH9I+6CyhbRdepVVFTAgMBAAGgADADBgEAAwEA -----END CERTIFICATE REQUEST----- Use of uninitialized value in subroutine entry at t/Mytest.t line 38. *** stack smashing detected ***: /usr/bin/perl terminated ======= Backtrace: ========= /lib64/libc.so.6(+0x7899f)[0x7ffb2063f99f] /lib64/libc.so.6(__fortify_fail+0x37)[0x7ffb206d2b37] /lib64/libc.so.6(__fortify_fail+0x0)[0x7ffb206d2b00] /home/test/fedora/perl-Crypt-OpenSSL-PKCS10/Crypt-OpenSSL-PKCS10-0.09/blib/arch/auto/Crypt/OpenSSL/PKCS10/PKCS10.so(+0x3b05)[0x7ffb19c2eb05] /lib64/libperl.so.5.18(Perl_pp_entersub+0x5a1)[0x7ffb219eb471] /lib64/libperl.so.5.18(Perl_runops_standard+0x2e)[0x7ffb219e387e] /lib64/libperl.so.5.18(perl_run+0x300)[0x7ffb2197ac10] /usr/bin/perl[0x400d29] /lib64/libc.so.6(__libc_start_main+0xf5)[0x7ffb205e8fa5] /usr/bin/perl[0x400d61] [...] This is caused by code: $req->add_custom_ext_raw($oid, pack('H*','1E06006100620063')); The $oid is not declared and not defined. Replacing the $oid with a '1.2.3.4' makes the test to pass. I think add_custom_ext_raw() and similar functions should check for defines of the OID scalar value. I have openssl-1.0.1e and glibc-2.17.90 on x86_64 Linux.
From: ppisar [...] redhat.com
Dne Pá 19.čec.2013 08:55:23, ppisar napsal(a): Show quoted text
> > $req->add_custom_ext_raw($oid, pack('H*','1E06006100620063')); > > The $oid is not declared and not defined. Replacing the $oid with a > '1.2.3.4' makes the test to pass. >
Attached patch does that. Show quoted text
> I have openssl-1.0.1e and glibc-2.17.90 on x86_64 Linux.
And perl-5.18.0. -- Petr
Subject: perl-Crypt-OpenSSL-PKCS10-Use-defined-OID-in-tests.patch
From 57f67f4e319731fe9d824e4c40c3125875f32021 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com> Date: Fri, 19 Jul 2013 15:01:18 +0200 Subject: [PATCH] Use defined OID in tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit <https://rt.cpan.org/Public/Bug/Display.html?id=87049> Signed-off-by: Petr Písař <ppisar@redhat.com> --- t/Mytest.t | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/Mytest.t b/t/Mytest.t index fb91b7c..32302b6 100644 --- a/t/Mytest.t +++ b/t/Mytest.t @@ -35,7 +35,7 @@ $req->add_ext(Crypt::OpenSSL::PKCS10::NID_key_usage,"critical,digitalSignature,k $req->add_ext(Crypt::OpenSSL::PKCS10::NID_ext_key_usage,"serverAuth, nsSGC, msSGC, 1.3.4"); $req->add_ext(Crypt::OpenSSL::PKCS10::NID_subject_alt_name,'email:steve@openssl.org'); $req->add_custom_ext('1.2.3.3',"My new extension"); -$req->add_custom_ext_raw($oid, pack('H*','1E06006100620063')); +$req->add_custom_ext_raw('1.2.3.4', pack('H*','1E06006100620063')); $req->add_ext_final(); $req->sign(); print STDERR $req->get_pem_req(); -- 1.8.1.4
Patch incorporated in version 0.10 For some reason it was working fine for me, even though $oid was obviously not defined. Thanks!