Latest update.
This commit is contained in:
@@ -235,16 +235,23 @@ static int aes_stream_final(void *vctx, unsigned char *out, size_t *outl,
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int aes_cipher(void *vctx, unsigned char *out, const unsigned char *in,
|
||||
size_t inl)
|
||||
static int aes_cipher(void *vctx,
|
||||
unsigned char *out, size_t *outl, size_t outsize,
|
||||
const unsigned char *in, size_t inl)
|
||||
{
|
||||
PROV_AES_KEY *ctx = (PROV_AES_KEY *)vctx;
|
||||
|
||||
if (outsize < inl) {
|
||||
PROVerr(PROV_F_AES_CIPHER, PROV_R_OUTPUT_BUFFER_TOO_SMALL);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!ctx->ciph->cipher(ctx, out, in, inl)) {
|
||||
PROVerr(PROV_F_AES_CIPHER, PROV_R_CIPHER_OPERATION_FAILED);
|
||||
return 0;
|
||||
}
|
||||
|
||||
*outl = inl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -263,7 +270,7 @@ static int aes_cipher(void *vctx, unsigned char *out, const unsigned char *in,
|
||||
|
||||
#define IMPLEMENT_new_ctx(lcmode, UCMODE, len) \
|
||||
static OSSL_OP_cipher_newctx_fn aes_##len##_##lcmode##_newctx; \
|
||||
static void *aes_##len##_##lcmode##_newctx(void) \
|
||||
static void *aes_##len##_##lcmode##_newctx(void *provctx) \
|
||||
{ \
|
||||
PROV_AES_KEY *ctx = OPENSSL_zalloc(sizeof(*ctx)); \
|
||||
\
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
/*
|
||||
* Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
@@ -9,12 +10,13 @@
|
||||
|
||||
#include <openssl/aes.h>
|
||||
#include <openssl/modes.h>
|
||||
#include "internal/cryptlib.h"
|
||||
|
||||
typedef struct prov_aes_cipher_st PROV_AES_CIPHER;
|
||||
|
||||
typedef struct prov_aes_key_st {
|
||||
union {
|
||||
double align;
|
||||
OSSL_UNION_ALIGN;
|
||||
AES_KEY ks;
|
||||
} ks;
|
||||
block128_f block;
|
||||
@@ -29,7 +31,7 @@ typedef struct prov_aes_key_st {
|
||||
#if defined(OPENSSL_CPUID_OBJ) && defined(__s390__)
|
||||
struct {
|
||||
union {
|
||||
double align;
|
||||
OSSL_UNION_ALIGN;
|
||||
/*-
|
||||
* KM-AES parameter block - begin
|
||||
* (see z/Architecture Principles of Operation >= SA22-7832-06)
|
||||
|
||||
Reference in New Issue
Block a user