/** @file\r
PKCS#7 SignedData Sign Wrapper Implementation over OpenSSL.\r
\r
-Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
#include <openssl/x509.h>\r
#include <openssl/pkcs7.h>\r
\r
-\r
/**\r
Creates a PKCS#7 signedData as described in "PKCS #7: Cryptographic Message\r
Syntax Standard, version 1.5". This interface is only intended to be used for\r
if (Key == NULL) {\r
goto _Exit;\r
}\r
- Key->save_type = EVP_PKEY_RSA;\r
- Key->type = EVP_PKEY_type (EVP_PKEY_RSA);\r
- Key->pkey.rsa = (RSA *) RsaContext;\r
+ if (EVP_PKEY_assign_RSA (Key, (RSA *) RsaContext) == 0) {\r
+ goto _Exit;\r
+ }\r
\r
//\r
// Convert the data to be signed to BIO format. \r
}\r
\r
CopyMem (*SignedData, P7Data + 19, *SignedDataSize);\r
- \r
+\r
OPENSSL_free (P7Data);\r
\r
Status = TRUE;\r
//\r
// Release Resources\r
//\r
- if (RsaContext != NULL) {\r
- RsaFree (RsaContext);\r
- if (Key != NULL) {\r
- Key->pkey.rsa = NULL;\r
- }\r
- }\r
-\r
if (Key != NULL) {\r
EVP_PKEY_free (Key);\r
}\r