--- trunk/t/local/33_x509_create_cert.t 2012/04/05 21:37:24 338 +++ trunk/t/local/33_x509_create_cert.t 2014/06/07 06:03:48 414 @@ -2,7 +2,7 @@ use strict; use warnings; -use Test::More tests => 124; +use Test::More tests => 123; use Net::SSLeay qw/MBSTRING_ASC MBSTRING_UTF8 EVP_PK_RSA EVP_PKT_SIGN EVP_PKT_ENC/; use File::Spec; use utf8; @@ -104,7 +104,11 @@ like(my $key_pem4 = Net::SSLeay::PEM_get_string_PrivateKey($pk,"password",$alg2), qr/-----BEGIN (ENCRYPTED|RSA) PRIVATE KEY-----/, "PEM_get_string_PrivateKey+passwd+enc_alg"); is(Net::SSLeay::X509_NAME_print_ex($name), "O=Company Name,C=UK,CN=Common name text X509", "X509_NAME_print_ex"); - is(unpack("H*",Net::SSLeay::X509_NAME_digest($name, $sha1_digest)), "044d7ea7fddced7b9b63799600b9989a63b36819", "X509_NAME_digest"); + + # 2014-06-06: Sigh, some versions of openssl have this patch, which afffects the results of this test: + # https://git.openssl.org/gitweb/?p=openssl.git;a=commit;h=3009244da47b989c4cc59ba02cf81a4e9d8f8431 + # with this patch, the result is "ce83889f1beab8e70aa142e07e94b0ebbd9d59e0" +# is(unpack("H*",Net::SSLeay::X509_NAME_digest($name, $sha1_digest)), "044d7ea7fddced7b9b63799600b9989a63b36819", "X509_NAME_digest"); ok(my $ext_idx = Net::SSLeay::X509_get_ext_by_NID($x509, &Net::SSLeay::NID_ext_key_usage), "X509_get_ext_by_NID"); ok(my $ext = Net::SSLeay::X509_get_ext($x509, $ext_idx), "X509_get_ext");