Subject: | [PATCH] Invalid comparison on OBJ_cmp result in t/local/36_verify.t |
The final test in t/local/36_verify.t compares two unequal ASN objects using OBJ_cmp and expects a return value of 1. The upstream documentation (http://www.openssl.org/docs/crypto/OBJ_nid2obj.html) says that OBJ_cmp returns zero for a match but doesn't specify the return value for a non-matching comparison. Whilst it appears that this value is pretty much always 1, I've just tried building on aarch64 and it came back with a value of 128, resulting in a test failure.
The attached patch changes the test to check for a non-zero value, which fixes the issue for me.
Subject: | Net-SSLeay-1.55-OBJ_cmp.patch |
Index: t/local/36_verify.t
===================================================================
--- t/local/36_verify.t (revision 387)
+++ t/local/36_verify.t (working copy)
@@ -60,6 +60,6 @@
my $asn_object2 = Net::SSLeay::OBJ_txt2obj('1.2.3.4', 0);
ok(Net::SSLeay::OBJ_cmp($asn_object2, $asn_object) == 0, 'OBJ_cmp');
$asn_object2 = Net::SSLeay::OBJ_txt2obj('1.2.3.5', 0);
-ok(Net::SSLeay::OBJ_cmp($asn_object2, $asn_object) == 1, 'OBJ_cmp');
+ok(Net::SSLeay::OBJ_cmp($asn_object2, $asn_object) != 0, 'OBJ_cmp');
ok(1, 'Finishing up');