The encoding of negative ASN1 INTEGERs and the conversion of BNs to negative integers was completely broken. Also added a NEG_PUBKEY_BUG compilation option to compensate for public keys improperly encoded as negative integers.
diff --git a/util/libeay.num b/util/libeay.num index 01299b1..7be174a 100755 --- a/util/libeay.num +++ b/util/libeay.num
@@ -1624,3 +1624,4 @@ EVP_CIPHER_type 1649 EVP_PBE_CipherInit 1650 X509V3_add_value_bool_nf 1651 +d2i_ASN1_UINTEGER 1652