Import OpenSSL 1.1.0h
This commit is contained in:
@@ -10,12 +10,10 @@
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
#include <errno.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "internal/cryptlib.h"
|
||||
|
||||
#ifndef NO_SYS_TYPES_H
|
||||
# include <sys/types.h>
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_POSIX_IO
|
||||
# include <sys/stat.h>
|
||||
#endif
|
||||
|
||||
@@ -42,12 +42,12 @@ static int by_file_ctrl(X509_LOOKUP *ctx, int cmd, const char *argp,
|
||||
long argl, char **ret)
|
||||
{
|
||||
int ok = 0;
|
||||
char *file;
|
||||
const char *file;
|
||||
|
||||
switch (cmd) {
|
||||
case X509_L_FILE_LOAD:
|
||||
if (argl == X509_FILETYPE_DEFAULT) {
|
||||
file = (char *)getenv(X509_get_default_cert_file_env());
|
||||
file = getenv(X509_get_default_cert_file_env());
|
||||
if (file)
|
||||
ok = (X509_load_cert_crl_file(ctx, file,
|
||||
X509_FILETYPE_PEM) != 0);
|
||||
@@ -90,7 +90,7 @@ int X509_load_cert_file(X509_LOOKUP *ctx, const char *file, int type)
|
||||
|
||||
if (type == X509_FILETYPE_PEM) {
|
||||
for (;;) {
|
||||
x = PEM_read_bio_X509_AUX(in, NULL, NULL, NULL);
|
||||
x = PEM_read_bio_X509_AUX(in, NULL, NULL, "");
|
||||
if (x == NULL) {
|
||||
if ((ERR_GET_REASON(ERR_peek_last_error()) ==
|
||||
PEM_R_NO_START_LINE) && (count > 0)) {
|
||||
@@ -147,7 +147,7 @@ int X509_load_crl_file(X509_LOOKUP *ctx, const char *file, int type)
|
||||
|
||||
if (type == X509_FILETYPE_PEM) {
|
||||
for (;;) {
|
||||
x = PEM_read_bio_X509_CRL(in, NULL, NULL, NULL);
|
||||
x = PEM_read_bio_X509_CRL(in, NULL, NULL, "");
|
||||
if (x == NULL) {
|
||||
if ((ERR_GET_REASON(ERR_peek_last_error()) ==
|
||||
PEM_R_NO_START_LINE) && (count > 0)) {
|
||||
@@ -199,7 +199,7 @@ int X509_load_cert_crl_file(X509_LOOKUP *ctx, const char *file, int type)
|
||||
X509err(X509_F_X509_LOAD_CERT_CRL_FILE, ERR_R_SYS_LIB);
|
||||
return 0;
|
||||
}
|
||||
inf = PEM_X509_INFO_read_bio(in, NULL, NULL, NULL);
|
||||
inf = PEM_X509_INFO_read_bio(in, NULL, NULL, "");
|
||||
BIO_free(in);
|
||||
if (!inf) {
|
||||
X509err(X509_F_X509_LOAD_CERT_CRL_FILE, ERR_R_PEM_LIB);
|
||||
|
||||
@@ -340,7 +340,7 @@ int X509_aux_print(BIO *out, X509 *x, int indent)
|
||||
BIO_puts(out, ", ");
|
||||
else
|
||||
first = 0;
|
||||
OBJ_obj2txt(oidstr, sizeof oidstr,
|
||||
OBJ_obj2txt(oidstr, sizeof(oidstr),
|
||||
sk_ASN1_OBJECT_value(trust, i), 0);
|
||||
BIO_puts(out, oidstr);
|
||||
}
|
||||
@@ -355,7 +355,7 @@ int X509_aux_print(BIO *out, X509 *x, int indent)
|
||||
BIO_puts(out, ", ");
|
||||
else
|
||||
first = 0;
|
||||
OBJ_obj2txt(oidstr, sizeof oidstr,
|
||||
OBJ_obj2txt(oidstr, sizeof(oidstr),
|
||||
sk_ASN1_OBJECT_value(reject, i), 0);
|
||||
BIO_puts(out, oidstr);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 1995-2018 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
|
||||
@@ -128,7 +128,8 @@ STACK_OF(X509_EXTENSION) *X509v3_add_ext(STACK_OF(X509_EXTENSION) **x,
|
||||
X509err(X509_F_X509V3_ADD_EXT, ERR_R_MALLOC_FAILURE);
|
||||
err2:
|
||||
X509_EXTENSION_free(new_ex);
|
||||
sk_X509_EXTENSION_free(sk);
|
||||
if (x != NULL && *x == NULL)
|
||||
sk_X509_EXTENSION_free(sk);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
|
||||
@@ -216,7 +216,6 @@ static int verify_chain(X509_STORE_CTX *ctx)
|
||||
if ((ok = build_chain(ctx)) == 0 ||
|
||||
(ok = check_chain_extensions(ctx)) == 0 ||
|
||||
(ok = check_auth_level(ctx)) == 0 ||
|
||||
(ok = check_name_constraints(ctx)) == 0 ||
|
||||
(ok = check_id(ctx)) == 0 || 1)
|
||||
X509_get_pubkey_parameters(NULL, ctx->chain);
|
||||
if (ok == 0 || (ok = ctx->check_revocation(ctx)) == 0)
|
||||
@@ -234,6 +233,9 @@ static int verify_chain(X509_STORE_CTX *ctx)
|
||||
if (!ok)
|
||||
return ok;
|
||||
|
||||
if ((ok = check_name_constraints(ctx)) == 0)
|
||||
return ok;
|
||||
|
||||
#ifndef OPENSSL_NO_RFC3779
|
||||
/* RFC 3779 path validation, now that CRL check has been done */
|
||||
if ((ok = X509v3_asid_validate_path(ctx)) == 0)
|
||||
|
||||
@@ -472,19 +472,11 @@ static int i2d_name_canon(STACK_OF(STACK_OF_X509_NAME_ENTRY) * _intname,
|
||||
|
||||
int X509_NAME_set(X509_NAME **xn, X509_NAME *name)
|
||||
{
|
||||
X509_NAME *in;
|
||||
|
||||
if (!xn || !name)
|
||||
return (0);
|
||||
|
||||
if (*xn != name) {
|
||||
in = X509_NAME_dup(name);
|
||||
if (in != NULL) {
|
||||
X509_NAME_free(*xn);
|
||||
*xn = in;
|
||||
}
|
||||
}
|
||||
return (*xn != NULL);
|
||||
if ((name = X509_NAME_dup(name)) == NULL)
|
||||
return 0;
|
||||
X509_NAME_free(*xn);
|
||||
*xn = name;
|
||||
return 1;
|
||||
}
|
||||
|
||||
int X509_NAME_print(BIO *bp, const X509_NAME *name, int obase)
|
||||
|
||||
Reference in New Issue
Block a user