In the latest version of Openssl (1.0.2k), the API signature has changed, which gives us more flexibility. See below for more details.
int RSA_padding_check_PKCS1_OAEP_mgf1 (unsigned char * to, int tlen, const unsigned char * from, int flen, int num, const unsigned char * param, int plen, const EVP_MD * md, const EVP_MD * mgf1md)
You can pass the EVP_MD structure to invoke the SHA-256 hash using this.
source share