I am new to openssl and Crypto. In existing implementation of signing process I am using PKCS7_sign to generate signature and there by default SHA-1 is applied. I want to use advanced SHA-2 hashing algorithms. But problem is that PKCS7_sign doesn't take any parameter which would imply which hashing algorithm to be applied I went through its implementation and noticed that SHA-1 is hard-coded in code.

I amusing OpenSSL 0.9.8b. I am not sure if implementation of PKCS7_sign has been changed in new releases and am looking at correct code. Please let me know if anybody has any idea about how to deal with this case.