first step of v2 final release

This commit is contained in:
Zhi Guan
2017-11-05 21:00:36 +08:00
parent 480b9e8d88
commit 27bde477a5
395 changed files with 26341 additions and 31364 deletions

View File

@@ -176,8 +176,16 @@ int PKCS12_set_mac(PKCS12 *p12, const char *pass, int passlen,
unsigned int maclen;
ASN1_OCTET_STRING *macoct;
if (!md_type)
if (!md_type) {
#ifndef OPENSSL_NO_SHA
md_type = EVP_sha1();
#elif !defined(OPENSSL_NO_SM3)
md_type = EVP_sm3();
#else
PKCS12err(PKCS12_F_PKCS12_SET_MAC, PKCS12_R_NO_AVAIABLE_DIGEST);
return 0;
#endif
}
if (PKCS12_setup_mac(p12, iter, salt, saltlen, md_type) == PKCS12_ERROR) {
PKCS12err(PKCS12_F_PKCS12_SET_MAC, PKCS12_R_MAC_SETUP_ERROR);
return 0;