mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
AppleM1: Update openssl to v1.1.1l
This commit is contained in:
parent
1fe12b8e8c
commit
b787656eea
990 changed files with 13406 additions and 18710 deletions
|
@ -11,7 +11,7 @@
|
|||
#include "internal/cryptlib.h"
|
||||
#include <openssl/evp.h>
|
||||
#include <openssl/cmac.h>
|
||||
#include "internal/asn1_int.h"
|
||||
#include "crypto/asn1.h"
|
||||
|
||||
/*
|
||||
* CMAC "ASN1" method. This is just here to indicate the maximum CMAC output
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
#include <openssl/x509v3.h>
|
||||
#include <openssl/evp.h>
|
||||
#include <openssl/cmac.h>
|
||||
#include "internal/evp_int.h"
|
||||
#include "crypto/evp.h"
|
||||
|
||||
/* The context structure and "key" is simply a CMAC_CTX */
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2010-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2010-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the OpenSSL license (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
|
@ -116,11 +116,18 @@ int CMAC_Init(CMAC_CTX *ctx, const void *key, size_t keylen,
|
|||
return 1;
|
||||
}
|
||||
/* Initialise context */
|
||||
if (cipher && !EVP_EncryptInit_ex(ctx->cctx, cipher, impl, NULL, NULL))
|
||||
return 0;
|
||||
if (cipher != NULL) {
|
||||
/* Ensure we can't use this ctx until we also have a key */
|
||||
ctx->nlast_block = -1;
|
||||
if (!EVP_EncryptInit_ex(ctx->cctx, cipher, impl, NULL, NULL))
|
||||
return 0;
|
||||
}
|
||||
/* Non-NULL key means initialisation complete */
|
||||
if (key) {
|
||||
if (key != NULL) {
|
||||
int bl;
|
||||
|
||||
/* If anything fails then ensure we can't use this ctx */
|
||||
ctx->nlast_block = -1;
|
||||
if (!EVP_CIPHER_CTX_cipher(ctx->cctx))
|
||||
return 0;
|
||||
if (!EVP_CIPHER_CTX_set_key_length(ctx->cctx, keylen))
|
||||
|
@ -128,7 +135,7 @@ int CMAC_Init(CMAC_CTX *ctx, const void *key, size_t keylen,
|
|||
if (!EVP_EncryptInit_ex(ctx->cctx, NULL, NULL, key, zero_iv))
|
||||
return 0;
|
||||
bl = EVP_CIPHER_CTX_block_size(ctx->cctx);
|
||||
if (!EVP_Cipher(ctx->cctx, ctx->tbl, zero_iv, bl))
|
||||
if (EVP_Cipher(ctx->cctx, ctx->tbl, zero_iv, bl) <= 0)
|
||||
return 0;
|
||||
make_kn(ctx->k1, ctx->tbl, bl);
|
||||
make_kn(ctx->k2, ctx->k1, bl);
|
||||
|
@ -166,12 +173,12 @@ int CMAC_Update(CMAC_CTX *ctx, const void *in, size_t dlen)
|
|||
return 1;
|
||||
data += nleft;
|
||||
/* Else not final block so encrypt it */
|
||||
if (!EVP_Cipher(ctx->cctx, ctx->tbl, ctx->last_block, bl))
|
||||
if (EVP_Cipher(ctx->cctx, ctx->tbl, ctx->last_block, bl) <= 0)
|
||||
return 0;
|
||||
}
|
||||
/* Encrypt all but one of the complete blocks left */
|
||||
while (dlen > bl) {
|
||||
if (!EVP_Cipher(ctx->cctx, ctx->tbl, data, bl))
|
||||
if (EVP_Cipher(ctx->cctx, ctx->tbl, data, bl) <= 0)
|
||||
return 0;
|
||||
dlen -= bl;
|
||||
data += bl;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue