mirror of https://github.com/thesofproject/sof.git
rimage: openssl: add compatibility for openssl 1.1.0
Add compatibility support for openssl 1.0.2 support alongsid with openssl 1.1.0 References: https://wiki.openssl.org/index.php/OpenSSL_1.1.0_Changes Compatibility Layer Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
This commit is contained in:
parent
82f6d74ee3
commit
82f6bfba4e
|
@ -30,6 +30,32 @@
|
|||
#include "file_format.h"
|
||||
#include "manifest.h"
|
||||
|
||||
#if OPENSSL_VERSION_NUMBER < 0x10100000L
|
||||
void EVP_MD_CTX_free(EVP_MD_CTX *ctx);
|
||||
EVP_MD_CTX *EVP_MD_CTX_new(void);
|
||||
|
||||
static void *OPENSSL_zalloc(size_t num)
|
||||
{
|
||||
void *ret = OPENSSL_malloc(num);
|
||||
|
||||
if (ret != NULL)
|
||||
memset(ret, 0, num);
|
||||
return ret;
|
||||
}
|
||||
|
||||
EVP_MD_CTX *EVP_MD_CTX_new(void)
|
||||
{
|
||||
return OPENSSL_zalloc(sizeof(EVP_MD_CTX));
|
||||
}
|
||||
|
||||
void EVP_MD_CTX_free(EVP_MD_CTX *ctx)
|
||||
{
|
||||
EVP_MD_CTX_cleanup(ctx);
|
||||
OPENSSL_free(ctx);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#define DEBUG_HASH 0
|
||||
|
||||
void module_sha256_create(struct image *image)
|
||||
|
|
|
@ -30,6 +30,22 @@
|
|||
#include "css.h"
|
||||
#include "manifest.h"
|
||||
|
||||
#if OPENSSL_VERSION_NUMBER < 0x10100000L
|
||||
void RSA_get0_key(const RSA *r,
|
||||
const BIGNUM **n, const BIGNUM **e, const BIGNUM **d);
|
||||
|
||||
void RSA_get0_key(const RSA *r,
|
||||
const BIGNUM **n, const BIGNUM **e, const BIGNUM **d)
|
||||
{
|
||||
if (n != NULL)
|
||||
*n = r->n;
|
||||
if (e != NULL)
|
||||
*e = r->e;
|
||||
if (d != NULL)
|
||||
*d = r->d;
|
||||
}
|
||||
#endif
|
||||
|
||||
#define DEBUG_PKCS 0
|
||||
|
||||
static void bytes_swap(uint8_t *ptr, uint32_t size)
|
||||
|
|
Loading…
Reference in New Issue