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
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2004-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2004-2021 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright (c) 2004, EdelKey Project. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the OpenSSL license (the "License"). You may not use
|
||||
|
@ -16,7 +16,7 @@
|
|||
# include <openssl/sha.h>
|
||||
# include <openssl/srp.h>
|
||||
# include <openssl/evp.h>
|
||||
# include "internal/bn_srp.h"
|
||||
# include "crypto/bn_srp.h"
|
||||
|
||||
/* calculate = SHA1(PAD(x) || PAD(y)) */
|
||||
|
||||
|
@ -177,6 +177,7 @@ BIGNUM *SRP_Calc_client_key(const BIGNUM *N, const BIGNUM *B, const BIGNUM *g,
|
|||
const BIGNUM *x, const BIGNUM *a, const BIGNUM *u)
|
||||
{
|
||||
BIGNUM *tmp = NULL, *tmp2 = NULL, *tmp3 = NULL, *k = NULL, *K = NULL;
|
||||
BIGNUM *xtmp = NULL;
|
||||
BN_CTX *bn_ctx;
|
||||
|
||||
if (u == NULL || B == NULL || N == NULL || g == NULL || x == NULL
|
||||
|
@ -185,10 +186,13 @@ BIGNUM *SRP_Calc_client_key(const BIGNUM *N, const BIGNUM *B, const BIGNUM *g,
|
|||
|
||||
if ((tmp = BN_new()) == NULL ||
|
||||
(tmp2 = BN_new()) == NULL ||
|
||||
(tmp3 = BN_new()) == NULL)
|
||||
(tmp3 = BN_new()) == NULL ||
|
||||
(xtmp = BN_new()) == NULL)
|
||||
goto err;
|
||||
|
||||
if (!BN_mod_exp(tmp, g, x, N, bn_ctx))
|
||||
BN_with_flags(xtmp, x, BN_FLG_CONSTTIME);
|
||||
BN_set_flags(tmp, BN_FLG_CONSTTIME);
|
||||
if (!BN_mod_exp(tmp, g, xtmp, N, bn_ctx))
|
||||
goto err;
|
||||
if ((k = srp_Calc_k(N, g)) == NULL)
|
||||
goto err;
|
||||
|
@ -196,7 +200,7 @@ BIGNUM *SRP_Calc_client_key(const BIGNUM *N, const BIGNUM *B, const BIGNUM *g,
|
|||
goto err;
|
||||
if (!BN_mod_sub(tmp, B, tmp2, N, bn_ctx))
|
||||
goto err;
|
||||
if (!BN_mul(tmp3, u, x, bn_ctx))
|
||||
if (!BN_mul(tmp3, u, xtmp, bn_ctx))
|
||||
goto err;
|
||||
if (!BN_add(tmp2, a, tmp3))
|
||||
goto err;
|
||||
|
@ -208,6 +212,7 @@ BIGNUM *SRP_Calc_client_key(const BIGNUM *N, const BIGNUM *B, const BIGNUM *g,
|
|||
|
||||
err:
|
||||
BN_CTX_free(bn_ctx);
|
||||
BN_free(xtmp);
|
||||
BN_clear_free(tmp);
|
||||
BN_clear_free(tmp2);
|
||||
BN_clear_free(tmp3);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2004-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2004-2021 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright (c) 2004, EdelKey Project. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the OpenSSL license (the "License"). You may not use
|
||||
|
@ -13,7 +13,7 @@
|
|||
|
||||
#ifndef OPENSSL_NO_SRP
|
||||
# include "internal/cryptlib.h"
|
||||
# include "internal/evp_int.h"
|
||||
# include "crypto/evp.h"
|
||||
# include <openssl/sha.h>
|
||||
# include <openssl/srp.h>
|
||||
# include <openssl/evp.h>
|
||||
|
@ -684,7 +684,7 @@ int SRP_create_verifier_BN(const char *user, const char *pass, BIGNUM **salt,
|
|||
BIGNUM *x = NULL;
|
||||
BN_CTX *bn_ctx = BN_CTX_new();
|
||||
unsigned char tmp2[MAX_LEN];
|
||||
BIGNUM *salttmp = NULL;
|
||||
BIGNUM *salttmp = NULL, *verif;
|
||||
|
||||
if ((user == NULL) ||
|
||||
(pass == NULL) ||
|
||||
|
@ -707,17 +707,18 @@ int SRP_create_verifier_BN(const char *user, const char *pass, BIGNUM **salt,
|
|||
if (x == NULL)
|
||||
goto err;
|
||||
|
||||
*verifier = BN_new();
|
||||
if (*verifier == NULL)
|
||||
verif = BN_new();
|
||||
if (verif == NULL)
|
||||
goto err;
|
||||
|
||||
if (!BN_mod_exp(*verifier, g, x, N, bn_ctx)) {
|
||||
BN_clear_free(*verifier);
|
||||
if (!BN_mod_exp(verif, g, x, N, bn_ctx)) {
|
||||
BN_clear_free(verif);
|
||||
goto err;
|
||||
}
|
||||
|
||||
result = 1;
|
||||
*salt = salttmp;
|
||||
*verifier = verif;
|
||||
|
||||
err:
|
||||
if (salt != NULL && *salt != salttmp)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue