Add PKCS8 error

This commit is contained in:
Grégory Soutadé 2022-02-22 20:58:14 +01:00
parent ef62fb921a
commit 7d93817e49
2 changed files with 2 additions and 1 deletions

View File

@ -110,6 +110,7 @@ namespace gourou
CLIENT_ZIP_ERROR, CLIENT_ZIP_ERROR,
CLIENT_GENERIC_EXCEPTION, CLIENT_GENERIC_EXCEPTION,
CLIENT_NETWORK_ERROR, CLIENT_NETWORK_ERROR,
CLIENT_INVALID_PKCS8,
}; };
enum DRM_REMOVAL_ERROR { enum DRM_REMOVAL_ERROR {

View File

@ -184,7 +184,7 @@ void DRMProcessorClientImpl::RSAPrivateDecrypt(const unsigned char* RSAKey, unsi
PKCS8_PRIV_KEY_INFO* p8inf = d2i_PKCS8_PRIV_KEY_INFO_bio(mem, NULL); PKCS8_PRIV_KEY_INFO* p8inf = d2i_PKCS8_PRIV_KEY_INFO_bio(mem, NULL);
if (!p8inf) if (!p8inf)
EXCEPTION(gourou::CLIENT_INVALID_PKCS12, ERR_error_string(ERR_get_error(), NULL)); EXCEPTION(gourou::CLIENT_INVALID_PKCS8, ERR_error_string(ERR_get_error(), NULL));
EVP_PKEY* pkey = EVP_PKCS82PKEY(p8inf); EVP_PKEY* pkey = EVP_PKCS82PKEY(p8inf);
RSA * rsa; RSA * rsa;