Latest update.
This commit is contained in:
@@ -69,9 +69,11 @@ static int aes_set_ctx_params(void *vctx, const OSSL_PARAM params[])
|
||||
PROV_AES_HMAC_SHA_CTX *ctx = (PROV_AES_HMAC_SHA_CTX *)vctx;
|
||||
PROV_CIPHER_HW_AES_HMAC_SHA *hw =
|
||||
(PROV_CIPHER_HW_AES_HMAC_SHA *)ctx->hw;
|
||||
EVP_CTRL_TLS1_1_MULTIBLOCK_PARAM mb_param;
|
||||
const OSSL_PARAM *p, *p1, *pin;
|
||||
const OSSL_PARAM *p;
|
||||
int ret = 1;
|
||||
# if !defined(OPENSSL_NO_MULTIBLOCK)
|
||||
EVP_CTRL_TLS1_1_MULTIBLOCK_PARAM mb_param;
|
||||
# endif
|
||||
|
||||
p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_AEAD_MAC_KEY);
|
||||
if (p != NULL) {
|
||||
@@ -101,8 +103,8 @@ static int aes_set_ctx_params(void *vctx, const OSSL_PARAM params[])
|
||||
*/
|
||||
p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_AAD);
|
||||
if (p != NULL) {
|
||||
p1 = OSSL_PARAM_locate_const(params,
|
||||
OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_INTERLEAVE);
|
||||
const OSSL_PARAM *p1 = OSSL_PARAM_locate_const(params,
|
||||
OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_INTERLEAVE);
|
||||
if (p->data_type != OSSL_PARAM_OCTET_STRING
|
||||
|| p1 == NULL
|
||||
|| !OSSL_PARAM_get_uint(p1, &mb_param.interleave)) {
|
||||
@@ -126,10 +128,11 @@ static int aes_set_ctx_params(void *vctx, const OSSL_PARAM params[])
|
||||
*/
|
||||
p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_ENC);
|
||||
if (p != NULL) {
|
||||
p1 = OSSL_PARAM_locate_const(params,
|
||||
OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_INTERLEAVE);
|
||||
pin = OSSL_PARAM_locate_const(params,
|
||||
OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_ENC_IN);
|
||||
const OSSL_PARAM *p1 = OSSL_PARAM_locate_const(params,
|
||||
OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_INTERLEAVE);
|
||||
const OSSL_PARAM *pin = OSSL_PARAM_locate_const(params,
|
||||
OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_ENC_IN);
|
||||
|
||||
if (p->data_type != OSSL_PARAM_OCTET_STRING
|
||||
|| pin == NULL
|
||||
|| pin->data_type != OSSL_PARAM_OCTET_STRING
|
||||
@@ -175,13 +178,13 @@ static int aes_set_ctx_params(void *vctx, const OSSL_PARAM params[])
|
||||
static int aes_get_ctx_params(void *vctx, OSSL_PARAM params[])
|
||||
{
|
||||
PROV_AES_HMAC_SHA_CTX *ctx = (PROV_AES_HMAC_SHA_CTX *)vctx;
|
||||
PROV_CIPHER_HW_AES_HMAC_SHA *hw =
|
||||
(PROV_CIPHER_HW_AES_HMAC_SHA *)ctx->hw;
|
||||
OSSL_PARAM *p;
|
||||
|
||||
# if !defined(OPENSSL_NO_MULTIBLOCK)
|
||||
p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_MAX_BUFSIZE);
|
||||
if (p != NULL) {
|
||||
PROV_CIPHER_HW_AES_HMAC_SHA *hw =
|
||||
(PROV_CIPHER_HW_AES_HMAC_SHA *)ctx->hw;
|
||||
size_t len = hw->tls1_multiblock_max_bufsize(ctx);
|
||||
|
||||
if (!OSSL_PARAM_set_size_t(p, len)) {
|
||||
@@ -280,7 +283,7 @@ static void aes_cbc_hmac_sha1_freectx(void *vctx)
|
||||
PROV_AES_HMAC_SHA1_CTX *ctx = (PROV_AES_HMAC_SHA1_CTX *)vctx;
|
||||
|
||||
if (ctx != NULL)
|
||||
OPENSSL_clear_free(ctx, sizeof(ctx));
|
||||
OPENSSL_clear_free(ctx, sizeof(*ctx));
|
||||
}
|
||||
|
||||
static void *aes_cbc_hmac_sha256_newctx(void *provctx, size_t kbits,
|
||||
@@ -301,7 +304,7 @@ static void aes_cbc_hmac_sha256_freectx(void *vctx)
|
||||
PROV_AES_HMAC_SHA256_CTX *ctx = (PROV_AES_HMAC_SHA256_CTX *)vctx;
|
||||
|
||||
if (ctx != NULL)
|
||||
OPENSSL_clear_free(ctx, sizeof(ctx));
|
||||
OPENSSL_clear_free(ctx, sizeof(*ctx));
|
||||
}
|
||||
|
||||
# define IMPLEMENT_CIPHER(nm, sub, kbits, blkbits, ivbits, flags) \
|
||||
|
||||
@@ -13,10 +13,6 @@
|
||||
int cipher_capable_aes_cbc_hmac_sha1(void);
|
||||
int cipher_capable_aes_cbc_hmac_sha256(void);
|
||||
|
||||
#ifdef AES_CBC_HMAC_SHA_CAPABLE
|
||||
# include <openssl/aes.h>
|
||||
# include <openssl/sha.h>
|
||||
|
||||
typedef struct prov_cipher_hw_aes_hmac_sha_ctx_st {
|
||||
PROV_CIPHER_HW base; /* must be first */
|
||||
void (*init_mac_key)(void *ctx, const unsigned char *inkey, size_t inlen);
|
||||
@@ -30,6 +26,13 @@ typedef struct prov_cipher_hw_aes_hmac_sha_ctx_st {
|
||||
# endif /* OPENSSL_NO_MULTIBLOCK) */
|
||||
} PROV_CIPHER_HW_AES_HMAC_SHA;
|
||||
|
||||
const PROV_CIPHER_HW_AES_HMAC_SHA *PROV_CIPHER_HW_aes_cbc_hmac_sha1(void);
|
||||
const PROV_CIPHER_HW_AES_HMAC_SHA *PROV_CIPHER_HW_aes_cbc_hmac_sha256(void);
|
||||
|
||||
#ifdef AES_CBC_HMAC_SHA_CAPABLE
|
||||
# include <openssl/aes.h>
|
||||
# include <openssl/sha.h>
|
||||
|
||||
typedef struct prov_aes_hmac_sha_ctx_st {
|
||||
PROV_CIPHER_CTX base;
|
||||
AES_KEY ks;
|
||||
@@ -59,7 +62,4 @@ typedef struct prov_aes_hmac_sha256_ctx_st {
|
||||
|
||||
# define NO_PAYLOAD_LENGTH ((size_t)-1)
|
||||
|
||||
const PROV_CIPHER_HW_AES_HMAC_SHA *PROV_CIPHER_HW_aes_cbc_hmac_sha1(void);
|
||||
const PROV_CIPHER_HW_AES_HMAC_SHA *PROV_CIPHER_HW_aes_cbc_hmac_sha256(void);
|
||||
|
||||
#endif /* AES_CBC_HMAC_SHA_CAPABLE */
|
||||
@@ -16,11 +16,16 @@
|
||||
|
||||
#include "cipher_aes_cbc_hmac_sha.h"
|
||||
|
||||
#ifndef AES_CBC_HMAC_SHA_CAPABLE
|
||||
#if !defined(AES_CBC_HMAC_SHA_CAPABLE) || !defined(AESNI_CAPABLE)
|
||||
int cipher_capable_aes_cbc_hmac_sha1(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
const PROV_CIPHER_HW_AES_HMAC_SHA *PROV_CIPHER_HW_aes_cbc_hmac_sha1(void)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
#else
|
||||
|
||||
# include <openssl/rand.h>
|
||||
@@ -765,7 +770,7 @@ static int aesni_cbc_hmac_sha1_tls1_multiblock_encrypt(
|
||||
param->interleave / 4);
|
||||
}
|
||||
|
||||
#endif /* OPENSSL_NO_MULTIBLOCK */
|
||||
# endif /* OPENSSL_NO_MULTIBLOCK */
|
||||
|
||||
static const PROV_CIPHER_HW_AES_HMAC_SHA cipher_hw_aes_hmac_sha1 = {
|
||||
{
|
||||
@@ -786,4 +791,4 @@ const PROV_CIPHER_HW_AES_HMAC_SHA *PROV_CIPHER_HW_aes_cbc_hmac_sha1(void)
|
||||
return &cipher_hw_aes_hmac_sha1;
|
||||
}
|
||||
|
||||
#endif /* AES_CBC_HMAC_SHA_CAPABLE */
|
||||
#endif /* !defined(AES_CBC_HMAC_SHA_CAPABLE) || !defined(AESNI_CAPABLE) */
|
||||
@@ -16,11 +16,16 @@
|
||||
|
||||
#include "cipher_aes_cbc_hmac_sha.h"
|
||||
|
||||
#ifndef AES_CBC_HMAC_SHA_CAPABLE
|
||||
#if !defined(AES_CBC_HMAC_SHA_CAPABLE) || !defined(AESNI_CAPABLE)
|
||||
int cipher_capable_aes_cbc_hmac_sha256(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
const PROV_CIPHER_HW_AES_HMAC_SHA *PROV_CIPHER_HW_aes_cbc_hmac_sha256(void)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
#else
|
||||
|
||||
# include <openssl/rand.h>
|
||||
@@ -814,7 +819,7 @@ static int aesni_cbc_hmac_sha256_tls1_multiblock_encrypt(
|
||||
param->inp, param->len,
|
||||
param->interleave / 4);
|
||||
}
|
||||
#endif
|
||||
# endif
|
||||
|
||||
static const PROV_CIPHER_HW_AES_HMAC_SHA cipher_hw_aes_hmac_sha256 = {
|
||||
{
|
||||
@@ -835,4 +840,4 @@ const PROV_CIPHER_HW_AES_HMAC_SHA *PROV_CIPHER_HW_aes_cbc_hmac_sha256(void)
|
||||
return &cipher_hw_aes_hmac_sha256;
|
||||
}
|
||||
|
||||
#endif /* AES_CBC_HMAC_SHA_CAPABLE */
|
||||
#endif /* !defined(AES_CBC_HMAC_SHA_CAPABLE) || !defined(AESNI_CAPABLE) */
|
||||
@@ -7,6 +7,12 @@
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
/*
|
||||
* DES low level APIs are deprecated for public use, but still ok for internal
|
||||
* use.
|
||||
*/
|
||||
#include "internal/deprecated.h"
|
||||
|
||||
#include "prov/ciphercommon.h"
|
||||
#include "cipher_des.h"
|
||||
#include <openssl/rand.h>
|
||||
|
||||
@@ -7,6 +7,12 @@
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
/*
|
||||
* DES low level APIs are deprecated for public use, but still ok for internal
|
||||
* use.
|
||||
*/
|
||||
#include "internal/deprecated.h"
|
||||
|
||||
#include "prov/ciphercommon.h"
|
||||
#include "cipher_des.h"
|
||||
|
||||
|
||||
@@ -7,6 +7,12 @@
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
/*
|
||||
* DES low level APIs are deprecated for public use, but still ok for internal
|
||||
* use.
|
||||
*/
|
||||
#include "internal/deprecated.h"
|
||||
|
||||
#include "cipher_tdes_default.h"
|
||||
#include "prov/implementations.h"
|
||||
|
||||
|
||||
@@ -7,6 +7,12 @@
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
/*
|
||||
* DES low level APIs are deprecated for public use, but still ok for internal
|
||||
* use.
|
||||
*/
|
||||
#include "internal/deprecated.h"
|
||||
|
||||
#include <openssl/des.h>
|
||||
#include "cipher_tdes_default.h"
|
||||
|
||||
|
||||
@@ -7,6 +7,12 @@
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
/*
|
||||
* DES low level APIs are deprecated for public use, but still ok for internal
|
||||
* use.
|
||||
*/
|
||||
#include "internal/deprecated.h"
|
||||
|
||||
#include "prov/ciphercommon.h"
|
||||
#include "cipher_tdes.h"
|
||||
#include <openssl/rand.h>
|
||||
|
||||
@@ -7,6 +7,12 @@
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
/*
|
||||
* DES low level APIs are deprecated for public use, but still ok for internal
|
||||
* use.
|
||||
*/
|
||||
#include "internal/deprecated.h"
|
||||
|
||||
#include "cipher_tdes_default.h"
|
||||
#include "prov/implementations.h"
|
||||
|
||||
|
||||
@@ -7,6 +7,12 @@
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
/*
|
||||
* DES low level APIs are deprecated for public use, but still ok for internal
|
||||
* use.
|
||||
*/
|
||||
#include "internal/deprecated.h"
|
||||
|
||||
#include "cipher_tdes_default.h"
|
||||
|
||||
#define ks1 tks.ks[0]
|
||||
|
||||
@@ -7,6 +7,12 @@
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
/*
|
||||
* DES low level APIs are deprecated for public use, but still ok for internal
|
||||
* use.
|
||||
*/
|
||||
#include "internal/deprecated.h"
|
||||
|
||||
#include "prov/ciphercommon.h"
|
||||
#include "cipher_tdes.h"
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* SHA-1 low level APIs are deprecated for public use, but still ok for
|
||||
* DES and SHA-1 low level APIs are deprecated for public use, but still ok for
|
||||
* internal use.
|
||||
*/
|
||||
#include "internal/deprecated.h"
|
||||
|
||||
@@ -7,6 +7,12 @@
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
/*
|
||||
* DES low level APIs are deprecated for public use, but still ok for internal
|
||||
* use.
|
||||
*/
|
||||
#include "internal/deprecated.h"
|
||||
|
||||
#include "cipher_tdes_default.h"
|
||||
|
||||
#define cipher_hw_tdes_wrap_initkey cipher_hw_tdes_ede3_initkey
|
||||
|
||||
Reference in New Issue
Block a user