backport OpenSSL patch function for 1.0.1g