Import OpenSSL 1.1.1t
This commit is contained in:
+14
-4
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 1995-2023 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
|
||||
@@ -332,9 +332,13 @@ static int get_cert_by_subject(X509_LOOKUP *xl, X509_LOOKUP_TYPE type,
|
||||
tmp = sk_X509_OBJECT_value(xl->store_ctx->objs, j);
|
||||
X509_STORE_unlock(xl->store_ctx);
|
||||
|
||||
/* If a CRL, update the last file suffix added for this */
|
||||
|
||||
if (type == X509_LU_CRL) {
|
||||
/*
|
||||
* If a CRL, update the last file suffix added for this.
|
||||
* We don't need to add an entry if k is 0 as this is the initial value.
|
||||
* This avoids the need for a write lock and sort operation in the
|
||||
* simple case where no CRL is present for a hash.
|
||||
*/
|
||||
if (type == X509_LU_CRL && k > 0) {
|
||||
CRYPTO_THREAD_write_lock(ctx->lock);
|
||||
/*
|
||||
* Look for entry again in case another thread added an entry
|
||||
@@ -362,6 +366,12 @@ static int get_cert_by_subject(X509_LOOKUP *xl, X509_LOOKUP_TYPE type,
|
||||
ok = 0;
|
||||
goto finish;
|
||||
}
|
||||
|
||||
/*
|
||||
* Ensure stack is sorted so that subsequent sk_BY_DIR_HASH_find
|
||||
* will not mutate the stack and therefore require a write lock.
|
||||
*/
|
||||
sk_BY_DIR_HASH_sort(ent->hashes);
|
||||
} else if (hent->suffix < k) {
|
||||
hent->suffix = k;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 1995-2023 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
|
||||
@@ -493,9 +493,7 @@ int X509_NAME_set(X509_NAME **xn, X509_NAME *name)
|
||||
int X509_NAME_print(BIO *bp, const X509_NAME *name, int obase)
|
||||
{
|
||||
char *s, *c, *b;
|
||||
int l, i;
|
||||
|
||||
l = 80 - 2 - obase;
|
||||
int i;
|
||||
|
||||
b = X509_NAME_oneline(name, NULL, 0);
|
||||
if (!b)
|
||||
@@ -521,12 +519,10 @@ int X509_NAME_print(BIO *bp, const X509_NAME *name, int obase)
|
||||
if (BIO_write(bp, ", ", 2) != 2)
|
||||
goto err;
|
||||
}
|
||||
l--;
|
||||
}
|
||||
if (*s == '\0')
|
||||
break;
|
||||
s++;
|
||||
l--;
|
||||
}
|
||||
|
||||
OPENSSL_free(b);
|
||||
|
||||
Reference in New Issue
Block a user