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.