Latest update.

This commit is contained in:
2020-04-25 19:56:17 +09:00
parent 2015c00c43
commit 80ef640063
5977 changed files with 13451 additions and 5979 deletions
+3 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -22,6 +22,8 @@
#include "crypto/x509.h"
#include "x509_local.h"
DEFINE_STACK_OF(X509_OBJECT)
struct lookup_dir_hashes_st {
unsigned long hash;
int suffix;
+2
View File
@@ -17,6 +17,8 @@
#include <openssl/pem.h>
#include "x509_local.h"
DEFINE_STACK_OF(X509_INFO)
static int by_file_ctrl(X509_LOOKUP *ctx, int cmd, const char *argc,
long argl, char **ret);
static X509_LOOKUP_METHOD x509_file_lookup = {
+3 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2018 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 2018-2020 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -12,6 +12,8 @@
#include "crypto/x509.h"
#include "x509_local.h"
DEFINE_STACK_OF_STRING()
/* Generic object loader, given expected type and criterion */
static int cache_objects(X509_LOOKUP *lctx, const char *uri,
const OSSL_STORE_SEARCH *criterion,
+2
View File
@@ -14,6 +14,8 @@
#include "pcy_local.h"
DEFINE_STACK_OF(POLICYINFO)
static int policy_data_cmp(const X509_POLICY_DATA *const *a,
const X509_POLICY_DATA *const *b);
static int policy_cache_set_int(long *out, ASN1_INTEGER *value);
+3
View File
@@ -13,6 +13,9 @@
#include "pcy_local.h"
DEFINE_STACK_OF(ASN1_OBJECT)
DEFINE_STACK_OF(POLICYQUALINFO)
/* Policy Node routines */
void policy_data_free(X509_POLICY_DATA *data)
+3 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2004-2016 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 2004-2020 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -13,6 +13,8 @@
#include "pcy_local.h"
DEFINE_STACK_OF(X509_POLICY_NODE)
/* accessor functions */
/* X509_POLICY_TREE stuff */
+3
View File
@@ -14,6 +14,9 @@
#include "pcy_local.h"
DEFINE_STACK_OF(POLICY_MAPPING)
DEFINE_STACK_OF(ASN1_OBJECT)
/*
* Set policy mapping entries in cache. Note: this modifies the passed
* POLICY_MAPPINGS structure
+3
View File
@@ -14,6 +14,9 @@
#include "pcy_local.h"
DEFINE_STACK_OF(X509_POLICY_NODE)
DEFINE_STACK_OF(ASN1_OBJECT)
static int node_cmp(const X509_POLICY_NODE *const *a,
const X509_POLICY_NODE *const *b)
{
+4
View File
@@ -14,6 +14,10 @@
#include "pcy_local.h"
DEFINE_STACK_OF(ASN1_OBJECT)
DEFINE_STACK_OF(X509)
DEFINE_STACK_OF(X509_POLICY_NODE)
static void expected_print(BIO *channel,
X509_POLICY_LEVEL *lev, X509_POLICY_NODE *node,
int indent)
+2
View File
@@ -15,6 +15,8 @@
#include <openssl/x509.h>
#include <openssl/x509v3.h>
DEFINE_STACK_OF(X509_REVOKED)
#ifndef OPENSSL_NO_STDIO
int X509_CRL_print_fp(FILE *fp, X509_CRL *x)
{
+2
View File
@@ -17,6 +17,8 @@
#include <openssl/rsa.h>
#include <openssl/dsa.h>
DEFINE_STACK_OF(X509_EXTENSION)
#ifndef OPENSSL_NO_STDIO
int X509_REQ_print_fp(FILE *fp, X509_REQ *x)
{
+4 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -17,6 +17,9 @@
#include "crypto/asn1.h"
#include "crypto/x509.h"
DEFINE_STACK_OF(X509)
DEFINE_STACK_OF(ASN1_OBJECT)
#ifndef OPENSSL_NO_STDIO
int X509_print_fp(FILE *fp, X509 *x)
{
+5
View File
@@ -25,6 +25,11 @@
#ifndef OPENSSL_NO_RFC3779
DEFINE_STACK_OF(IPAddressOrRange)
DEFINE_STACK_OF(IPAddressFamily)
DEFINE_STACK_OF(CONF_VALUE)
DEFINE_STACK_OF(X509)
/*
* OpenSSL ASN.1 template translation of RFC 3779 2.2.3.
*/
+4
View File
@@ -20,6 +20,10 @@
#include "v3_admis.h"
#include "ext_dat.h"
DEFINE_STACK_OF(ADMISSIONS)
DEFINE_STACK_OF(PROFESSION_INFO)
DEFINE_STACK_OF(ASN1_STRING)
DEFINE_STACK_OF(ASN1_OBJECT)
ASN1_SEQUENCE(NAMING_AUTHORITY) = {
ASN1_OPT(NAMING_AUTHORITY, namingAuthorityId, ASN1_OBJECT),
+3
View File
@@ -15,6 +15,9 @@
#include <openssl/x509v3.h>
#include "ext_dat.h"
DEFINE_STACK_OF(CONF_VALUE)
DEFINE_STACK_OF(GENERAL_NAME)
static STACK_OF(CONF_VALUE) *i2v_AUTHORITY_KEYID(X509V3_EXT_METHOD *method,
AUTHORITY_KEYID *akeyid,
STACK_OF(CONF_VALUE)
+3
View File
@@ -13,6 +13,9 @@
#include <openssl/x509v3.h>
#include "ext_dat.h"
DEFINE_STACK_OF(CONF_VALUE)
DEFINE_STACK_OF(GENERAL_NAME)
static GENERAL_NAMES *v2i_subject_alt(X509V3_EXT_METHOD *method,
X509V3_CTX *ctx,
STACK_OF(CONF_VALUE) *nval);
+4
View File
@@ -55,6 +55,10 @@ IMPLEMENT_ASN1_FUNCTIONS(ASIdOrRange)
IMPLEMENT_ASN1_FUNCTIONS(ASIdentifierChoice)
IMPLEMENT_ASN1_FUNCTIONS(ASIdentifiers)
DEFINE_STACK_OF(ASIdOrRange)
DEFINE_STACK_OF(CONF_VALUE)
DEFINE_STACK_OF(X509)
/*
* i2r method for an ASIdentifierChoice.
*/
+2
View File
@@ -15,6 +15,8 @@
#include <openssl/x509v3.h>
#include "ext_dat.h"
DEFINE_STACK_OF(CONF_VALUE)
static STACK_OF(CONF_VALUE) *i2v_BASIC_CONSTRAINTS(X509V3_EXT_METHOD *method,
BASIC_CONSTRAINTS *bcons,
STACK_OF(CONF_VALUE)
+2
View File
@@ -13,6 +13,8 @@
#include <openssl/x509v3.h>
#include "ext_dat.h"
DEFINE_STACK_OF(CONF_VALUE)
static BIT_STRING_BITNAME ns_cert_type_table[] = {
{0, "SSL Client", "client"},
{1, "SSL Server", "server"},
+3
View File
@@ -17,6 +17,9 @@
#include "crypto/x509.h"
#include <openssl/x509v3.h>
DEFINE_STACK_OF(CONF_VALUE)
DEFINE_STACK_OF(X509_EXTENSION)
static int v3_check_critical(const char **value);
static int v3_check_generic(const char **value);
static X509_EXTENSION *do_ext_nconf(CONF *conf, X509V3_CTX *ctx, int ext_nid,
+5
View File
@@ -17,6 +17,11 @@
#include "pcy_local.h"
#include "ext_dat.h"
DEFINE_STACK_OF(CONF_VALUE)
DEFINE_STACK_OF(POLICYINFO)
DEFINE_STACK_OF(POLICYQUALINFO)
DEFINE_STACK_OF(ASN1_INTEGER)
/* Certificate policies extension support: this one is a bit complex... */
static int i2r_certpol(X509V3_EXT_METHOD *method, STACK_OF(POLICYINFO) *pol,
+6 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright 1999-2016 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 1999-2020 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -17,6 +17,11 @@
#include "crypto/x509.h"
#include "ext_dat.h"
DEFINE_STACK_OF(CONF_VALUE)
DEFINE_STACK_OF(GENERAL_NAME)
DEFINE_STACK_OF(DIST_POINT)
DEFINE_STACK_OF(X509_NAME_ENTRY)
static void *v2i_crld(const X509V3_EXT_METHOD *method,
X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval);
static int i2r_crldp(const X509V3_EXT_METHOD *method, void *pcrldp, BIO *out,
+3
View File
@@ -14,6 +14,9 @@
#include <openssl/x509v3.h>
#include "ext_dat.h"
DEFINE_STACK_OF(ASN1_OBJECT)
DEFINE_STACK_OF(CONF_VALUE)
static void *v2i_EXTENDED_KEY_USAGE(const X509V3_EXT_METHOD *method,
X509V3_CTX *ctx,
STACK_OF(CONF_VALUE) *nval);
+3 -3
View File
@@ -1,5 +1,5 @@
/*
* Copyright 1999-2016 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 1999-2020 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -29,7 +29,7 @@ char *i2s_ASN1_IA5STRING(X509V3_EXT_METHOD *method, ASN1_IA5STRING *ia5)
{
char *tmp;
if (!ia5 || !ia5->length)
if (ia5 == NULL || ia5->length == 0)
return NULL;
if ((tmp = OPENSSL_malloc(ia5->length + 1)) == NULL) {
X509V3err(X509V3_F_I2S_ASN1_IA5STRING, ERR_R_MALLOC_FAILURE);
@@ -44,7 +44,7 @@ ASN1_IA5STRING *s2i_ASN1_IA5STRING(X509V3_EXT_METHOD *method,
X509V3_CTX *ctx, const char *str)
{
ASN1_IA5STRING *ia5;
if (!str) {
if (str == NULL) {
X509V3err(X509V3_F_S2I_ASN1_IA5STRING,
X509V3_R_INVALID_NULL_ARGUMENT);
return NULL;
+3
View File
@@ -15,6 +15,9 @@
#include <openssl/x509v3.h>
#include "ext_dat.h"
DEFINE_STACK_OF(ACCESS_DESCRIPTION)
DEFINE_STACK_OF(CONF_VALUE)
static STACK_OF(CONF_VALUE) *i2v_AUTHORITY_INFO_ACCESS(X509V3_EXT_METHOD
*method, AUTHORITY_INFO_ACCESS
*ainfo, STACK_OF(CONF_VALUE)
+2
View File
@@ -15,6 +15,8 @@
#include <openssl/x509v3.h>
#include "ext_dat.h"
DEFINE_STACK_OF(CONF_VALUE)
/*
* Issuer Sign Tool (1.2.643.100.112) The name of the tool used to signs the subject (ASN1_SEQUENCE)
* This extention is required to obtain the status of a qualified certificate at Russian Federation.
+3
View File
@@ -16,6 +16,9 @@
#include "ext_dat.h"
DEFINE_STACK_OF(X509V3_EXT_METHOD)
DEFINE_STACK_OF(X509_EXTENSION)
static STACK_OF(X509V3_EXT_METHOD) *ext_list = NULL;
static int ext_cmp(const X509V3_EXT_METHOD *const *a,
+5 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2003-2018 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 2003-2020 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -19,6 +19,10 @@
#include "crypto/x509.h"
#include "ext_dat.h"
DEFINE_STACK_OF(CONF_VALUE)
DEFINE_STACK_OF(GENERAL_NAME)
DEFINE_STACK_OF(GENERAL_SUBTREE)
static void *v2i_NAME_CONSTRAINTS(const X509V3_EXT_METHOD *method,
X509V3_CTX *ctx,
STACK_OF(CONF_VALUE) *nval);
+2
View File
@@ -49,6 +49,8 @@
#include <openssl/x509v3.h>
#include "ext_dat.h"
DEFINE_STACK_OF(CONF_VALUE)
static int i2r_pci(X509V3_EXT_METHOD *method, PROXY_CERT_INFO_EXTENSION *ext,
BIO *out, int indent);
static PROXY_CERT_INFO_EXTENSION *r2i_pci(X509V3_EXT_METHOD *method,
+2
View File
@@ -15,6 +15,8 @@
#include <openssl/x509v3.h>
#include "ext_dat.h"
DEFINE_STACK_OF(CONF_VALUE)
static STACK_OF(CONF_VALUE) *i2v_POLICY_CONSTRAINTS(const X509V3_EXT_METHOD
*method, void *bcons, STACK_OF(CONF_VALUE)
*extlist);
+3
View File
@@ -14,6 +14,9 @@
#include <openssl/x509v3.h>
#include "ext_dat.h"
DEFINE_STACK_OF(POLICY_MAPPING)
DEFINE_STACK_OF(CONF_VALUE)
static void *v2i_POLICY_MAPPINGS(const X509V3_EXT_METHOD *method,
X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval);
static STACK_OF(CONF_VALUE) *i2v_POLICY_MAPPINGS(const X509V3_EXT_METHOD
+3
View File
@@ -14,6 +14,9 @@
#include <openssl/conf.h>
#include <openssl/x509v3.h>
DEFINE_STACK_OF(CONF_VALUE)
DEFINE_STACK_OF(X509_EXTENSION)
/* Extension printing routines */
static int unknown_ext_print(BIO *out, const unsigned char *ext, int extlen,
+14 -3
View File
@@ -15,6 +15,11 @@
#include "crypto/x509.h"
#include "internal/tsan_assist.h"
DEFINE_STACK_OF(GENERAL_NAME)
DEFINE_STACK_OF(DIST_POINT)
DEFINE_STACK_OF(X509_PURPOSE)
DEFINE_STACK_OF(ASN1_OBJECT)
static int check_ssl_ca(const X509 *x);
static int check_purpose_ssl_client(const X509_PURPOSE *xp, const X509 *x,
int ca);
@@ -811,14 +816,15 @@ static int no_check(const X509_PURPOSE *xp, const X509 *x, int ca)
* codes for X509_verify_cert()
*/
int X509_check_issued(X509 *issuer, X509 *subject)
int x509_check_issued_int(X509 *issuer, X509 *subject, OPENSSL_CTX *libctx,
const char *propq)
{
if (X509_NAME_cmp(X509_get_subject_name(issuer),
X509_get_issuer_name(subject)))
return X509_V_ERR_SUBJECT_ISSUER_MISMATCH;
if (!X509v3_cache_extensions(issuer, NULL, NULL)
|| !X509v3_cache_extensions(subject, NULL, NULL))
if (!X509v3_cache_extensions(issuer, libctx, propq)
|| !X509v3_cache_extensions(subject, libctx, propq))
return X509_V_ERR_UNSPECIFIED;
if (subject->akid) {
@@ -853,6 +859,11 @@ int X509_check_issued(X509 *issuer, X509 *subject)
return X509_V_OK;
}
int X509_check_issued(X509 *issuer, X509 *subject)
{
return x509_check_issued_int(issuer, subject, NULL, NULL);
}
int X509_check_akid(X509 *issuer, AUTHORITY_KEYID *akid)
{
+3
View File
@@ -15,6 +15,9 @@
#include <openssl/x509v3.h>
#include "ext_dat.h"
DEFINE_STACK_OF(SXNETID)
DEFINE_STACK_OF(CONF_VALUE)
/* Support for Thawte strong extranet extension */
#define SXNET_TEST
+3
View File
@@ -15,6 +15,9 @@
#include <openssl/x509v3.h>
#include "ext_dat.h"
DEFINE_STACK_OF(ASN1_INTEGER)
DEFINE_STACK_OF(CONF_VALUE)
static STACK_OF(CONF_VALUE) *i2v_TLS_FEATURE(const X509V3_EXT_METHOD *method,
TLS_FEATURE *tls_feature,
STACK_OF(CONF_VALUE) *ext_list);
+2 -1
View File
@@ -36,11 +36,12 @@ char *i2s_ASN1_UTF8STRING(X509V3_EXT_METHOD *method,
X509V3err(X509V3_F_I2S_ASN1_UTF8STRING, ERR_R_PASSED_NULL_PARAMETER);
return NULL;
}
if ((tmp = OPENSSL_zalloc(utf8->length + 1)) == NULL) {
if ((tmp = OPENSSL_malloc(utf8->length + 1)) == NULL) {
X509V3err(X509V3_F_I2S_ASN1_UTF8STRING, ERR_R_MALLOC_FAILURE);
return NULL;
}
memcpy(tmp, utf8->data, utf8->length);
tmp[utf8->length] = 0;
return tmp;
}
+7 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright 1999-2017 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 1999-2020 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -20,6 +20,12 @@
#include <openssl/bn.h>
#include "ext_dat.h"
DEFINE_STACK_OF(CONF_VALUE)
DEFINE_STACK_OF(GENERAL_NAME)
DEFINE_STACK_OF(ACCESS_DESCRIPTION)
DEFINE_STACK_OF(X509_EXTENSION)
DEFINE_STACK_OF_STRING()
static char *strip_spaces(char *name);
static int sk_strcmp(const char *const *a, const char *const *b);
static STACK_OF(OPENSSL_STRING) *get_email(const X509_NAME *name,
+3
View File
@@ -17,6 +17,9 @@
#include <openssl/x509v3.h>
#include "x509_local.h"
DEFINE_STACK_OF(X509_ATTRIBUTE)
DEFINE_STACK_OF(ASN1_TYPE)
int X509at_get_attr_count(const STACK_OF(X509_ATTRIBUTE) *x)
{
return sk_X509_ATTRIBUTE_num(x);
+11 -1
View File
@@ -16,11 +16,17 @@
#include <openssl/core_names.h>
#include "crypto/x509.h"
DEFINE_STACK_OF(X509)
int X509_issuer_and_serial_cmp(const X509 *a, const X509 *b)
{
int i;
const X509_CINF *ai, *bi;
if (b == NULL)
return a != NULL;
if (a == NULL)
return -1;
ai = &a->cert_info;
bi = &b->cert_info;
i = ASN1_INTEGER_cmp(&ai->serialNumber, &bi->serialNumber);
@@ -161,8 +167,12 @@ int X509_NAME_cmp(const X509_NAME *a, const X509_NAME *b)
{
int ret;
/* Ensure canonical encoding is present and up to date */
if (b == NULL)
return a != NULL;
if (a == NULL)
return -1;
/* Ensure canonical encoding is present and up to date */
if (!a->canon_enc || a->modified) {
ret = i2d_X509_NAME((X509_NAME *)a, NULL);
if (ret < 0)
+1 -1
View File
@@ -1,6 +1,6 @@
/*
* Generated by util/mkerr.pl DO NOT EDIT
* Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2014-2018 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 2014-2020 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
+6 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -15,6 +15,11 @@
#include <openssl/x509v3.h>
#include "x509_local.h"
DEFINE_STACK_OF(X509_LOOKUP)
DEFINE_STACK_OF(X509_OBJECT)
DEFINE_STACK_OF(X509_CRL)
DEFINE_STACK_OF(X509)
X509_LOOKUP *X509_LOOKUP_new(X509_LOOKUP_METHOD *method)
{
X509_LOOKUP *ret = OPENSSL_zalloc(sizeof(*ret));
+2
View File
@@ -14,6 +14,8 @@
#include <openssl/buffer.h>
#include "crypto/x509.h"
DEFINE_STACK_OF(X509_NAME_ENTRY)
/*
* Limit to ensure we don't overflow: much greater than
* anything encountered in practice.
+3 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -17,6 +17,8 @@
#include <openssl/objects.h>
#include <openssl/buffer.h>
DEFINE_STACK_OF(X509_ATTRIBUTE)
X509 *X509_REQ_to_X509(X509_REQ *r, int days, EVP_PKEY *pkey)
{
X509 *ret = NULL;
+13 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -286,6 +286,18 @@ void X509_REQ_get0_signature(const X509_REQ *req, const ASN1_BIT_STRING **psig,
*palg = &req->sig_alg;
}
void X509_REQ_set0_signature(X509_REQ *req, ASN1_BIT_STRING *psig)
{
if (req->signature)
ASN1_BIT_STRING_free(req->signature);
req->signature = psig;
}
int X509_REQ_set1_signature_algo(X509_REQ *req, X509_ALGOR *palg)
{
return X509_ALGOR_copy(&req->sig_alg, palg);
}
int X509_REQ_get_signature_nid(const X509_REQ *req)
{
return OBJ_obj2nid(req->sig_alg.algorithm);
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright 1995-2017 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
+3
View File
@@ -12,6 +12,9 @@
#include <openssl/x509v3.h>
#include "crypto/x509.h"
DEFINE_STACK_OF(X509_TRUST)
DEFINE_STACK_OF(ASN1_OBJECT)
static int tr_cmp(const X509_TRUST *const *a, const X509_TRUST *const *b);
static void trtable_free(X509_TRUST *p);
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright 1995-2017 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
+2
View File
@@ -17,6 +17,8 @@
#include <openssl/x509v3.h>
#include "x509_local.h"
DEFINE_STACK_OF(X509_EXTENSION)
int X509v3_get_ext_count(const STACK_OF(X509_EXTENSION) *x)
{
if (x == NULL)
+10 -3
View File
@@ -25,6 +25,13 @@
#include "crypto/x509.h"
#include "x509_local.h"
DEFINE_STACK_OF(X509)
DEFINE_STACK_OF(X509_REVOKED)
DEFINE_STACK_OF(GENERAL_NAME)
DEFINE_STACK_OF(X509_CRL)
DEFINE_STACK_OF(DIST_POINT)
DEFINE_STACK_OF_STRING()
/* CRL score values */
/* No unhandled critical extensions */
@@ -334,7 +341,7 @@ static int check_issued(X509_STORE_CTX *ctx, X509 *x, X509 *issuer)
return ss;
}
ret = X509_check_issued(issuer, x);
ret = x509_check_issued_int(issuer, x, ctx->libctx, ctx->propq);
if (ret == X509_V_OK) {
int i;
X509 *ch;
@@ -1763,7 +1770,7 @@ static int internal_verify(X509_STORE_CTX *ctx)
if (!verify_cb_cert(ctx, xi, xi != xs ? n+1 : n,
X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY))
return 0;
} else if (X509_verify(xs, pkey) <= 0) {
} else if (X509_verify_ex(xs, pkey, ctx->libctx, ctx->propq) <= 0) {
if (!verify_cb_cert(ctx, xs, n,
X509_V_ERR_CERT_SIGNATURE_FAILURE))
return 0;
@@ -2809,7 +2816,7 @@ static int check_dane_pkeys(X509_STORE_CTX *ctx)
if (t->usage != DANETLS_USAGE_DANE_TA ||
t->selector != DANETLS_SELECTOR_SPKI ||
t->mtype != DANETLS_MATCHING_FULL ||
X509_verify(cert, t->spki) <= 0)
X509_verify_ex(cert, t->spki, ctx->libctx, ctx->propq) <= 0)
continue;
/* Clear any PKIX-?? matches that failed to extend to a full chain */
+5 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2004-2018 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 2004-2020 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -18,6 +18,10 @@
#include "x509_local.h"
DEFINE_STACK_OF(ASN1_OBJECT)
DEFINE_STACK_OF(X509_VERIFY_PARAM)
DEFINE_STACK_OF_STRING()
/* X509_VERIFY_PARAM functions */
#define SET_HOST 0
+3 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2001-2017 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 2001-2020 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -16,6 +16,8 @@
#include <openssl/x509.h>
#include "crypto/x509.h"
DEFINE_STACK_OF(X509_REVOKED)
int X509_CRL_set_version(X509_CRL *x, long version)
{
if (x == NULL)
+3 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -16,6 +16,8 @@
#include <openssl/x509.h>
#include "crypto/x509.h"
DEFINE_STACK_OF(X509_NAME_ENTRY)
int X509_NAME_get_text_by_NID(const X509_NAME *name, int nid,
char *buf, int len)
{
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
+54 -6
View File
@@ -24,6 +24,7 @@
#include <openssl/rsa.h>
#include <openssl/dsa.h>
#include <openssl/x509v3.h>
#include "crypto/asn1.h"
static void clean_id_ctx(EVP_MD_CTX *ctx)
{
@@ -33,13 +34,14 @@ static void clean_id_ctx(EVP_MD_CTX *ctx)
EVP_MD_CTX_free(ctx);
}
static EVP_MD_CTX *make_id_ctx(EVP_PKEY *r, ASN1_OCTET_STRING *id)
static EVP_MD_CTX *make_id_ctx(EVP_PKEY *r, ASN1_OCTET_STRING *id,
OPENSSL_CTX *libctx, const char *propq)
{
EVP_MD_CTX *ctx = NULL;
EVP_PKEY_CTX *pctx = NULL;
if ((ctx = EVP_MD_CTX_new()) == NULL
|| (pctx = EVP_PKEY_CTX_new(r, NULL)) == NULL) {
|| (pctx = EVP_PKEY_CTX_new_from_pkey(libctx, r, propq)) == NULL) {
X509err(0, ERR_R_MALLOC_FAILURE);
goto error;
}
@@ -62,7 +64,7 @@ static EVP_MD_CTX *make_id_ctx(EVP_PKEY *r, ASN1_OCTET_STRING *id)
return NULL;
}
int X509_verify(X509 *a, EVP_PKEY *r)
int X509_verify_ex(X509 *a, EVP_PKEY *r, OPENSSL_CTX *libctx, const char *propq)
{
int rv = 0;
EVP_MD_CTX *ctx = NULL;
@@ -72,7 +74,7 @@ int X509_verify(X509 *a, EVP_PKEY *r)
return 0;
id = a->distinguishing_id;
if ((ctx = make_id_ctx(r, id)) != NULL) {
if ((ctx = make_id_ctx(r, id, libctx, propq)) != NULL) {
rv = ASN1_item_verify_ctx(ASN1_ITEM_rptr(X509_CINF), &a->sig_alg,
&a->signature, &a->cert_info, ctx);
clean_id_ctx(ctx);
@@ -80,14 +82,20 @@ int X509_verify(X509 *a, EVP_PKEY *r)
return rv;
}
int X509_REQ_verify(X509_REQ *a, EVP_PKEY *r)
int X509_verify(X509 *a, EVP_PKEY *r)
{
return X509_verify_ex(a, r, NULL, NULL);
}
int X509_REQ_verify_ex(X509_REQ *a, EVP_PKEY *r, OPENSSL_CTX *libctx,
const char *propq)
{
int rv = 0;
EVP_MD_CTX *ctx = NULL;
ASN1_OCTET_STRING *id = NULL;
id = a->distinguishing_id;
if ((ctx = make_id_ctx(r, id)) != NULL) {
if ((ctx = make_id_ctx(r, id, libctx, propq)) != NULL) {
rv = ASN1_item_verify_ctx(ASN1_ITEM_rptr(X509_REQ_INFO), &a->sig_alg,
a->signature, &a->req_info, ctx);
clean_id_ctx(ctx);
@@ -95,6 +103,11 @@ int X509_REQ_verify(X509_REQ *a, EVP_PKEY *r)
return rv;
}
int X509_REQ_verify(X509_REQ *a, EVP_PKEY *r)
{
return X509_REQ_verify_ex(a, r, NULL, NULL);
}
int NETSCAPE_SPKI_verify(NETSCAPE_SPKI *a, EVP_PKEY *r)
{
return (ASN1_item_verify(ASN1_ITEM_rptr(NETSCAPE_SPKAC),
@@ -594,6 +607,22 @@ EVP_PKEY *d2i_PrivateKey_fp(FILE *fp, EVP_PKEY **a)
return ASN1_d2i_fp_of(EVP_PKEY, EVP_PKEY_new, d2i_AutoPrivateKey, fp, a);
}
EVP_PKEY *d2i_PrivateKey_ex_fp(FILE *fp, EVP_PKEY **a, OPENSSL_CTX *libctx,
const char *propq)
{
BIO *b;
void *ret;
if ((b = BIO_new(BIO_s_file())) == NULL) {
X509err(0, ERR_R_BUF_LIB);
return NULL;
}
BIO_set_fp(b, fp, BIO_NOCLOSE);
ret = d2i_PrivateKey_ex_bio(b, a, libctx, propq);
BIO_free(b);
return ret;
}
int i2d_PUBKEY_fp(FILE *fp, const EVP_PKEY *pkey)
{
return ASN1_i2d_fp_of(EVP_PKEY, i2d_PUBKEY, fp, pkey);
@@ -642,6 +671,25 @@ EVP_PKEY *d2i_PrivateKey_bio(BIO *bp, EVP_PKEY **a)
return ASN1_d2i_bio_of(EVP_PKEY, EVP_PKEY_new, d2i_AutoPrivateKey, bp, a);
}
EVP_PKEY *d2i_PrivateKey_ex_bio(BIO *bp, EVP_PKEY **a, OPENSSL_CTX *libctx,
const char *propq)
{
BUF_MEM *b = NULL;
const unsigned char *p;
void *ret = NULL;
int len;
len = asn1_d2i_read_bio(bp, &b);
if (len < 0)
goto err;
p = (unsigned char *)b->data;
ret = d2i_AutoPrivateKey_ex(a, &p, len, libctx, propq);
err:
BUF_MEM_free(b);
return ret;
}
int i2d_PUBKEY_bio(BIO *bp, const EVP_PKEY *pkey)
{
return ASN1_i2d_bio_of(EVP_PKEY, i2d_PUBKEY, bp, pkey);
+2
View File
@@ -14,6 +14,8 @@
#include <openssl/x509.h>
#include "x509_local.h"
DEFINE_STACK_OF(ASN1_TYPE)
/*-
* X509_ATTRIBUTE: this has the following form:
*
+5
View File
@@ -15,6 +15,11 @@
#include <openssl/x509v3.h>
#include "x509_local.h"
DEFINE_STACK_OF(GENERAL_NAME)
DEFINE_STACK_OF(GENERAL_NAMES)
DEFINE_STACK_OF(X509_REVOKED)
DEFINE_STACK_OF(X509_EXTENSION)
static int X509_REVOKED_cmp(const X509_REVOKED *const *a,
const X509_REVOKED *const *b);
static int setup_idp(X509_CRL *crl, ISSUING_DIST_POINT *idp);
+4 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -16,6 +16,9 @@
#include "crypto/asn1.h"
#include "x509_local.h"
DEFINE_STACK_OF(X509_NAME_ENTRY)
DEFINE_STACK_OF(ASN1_VALUE)
/*
* Maximum length of X509_NAME: much larger than anything we should
* ever see in practice.
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
+3 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -13,6 +13,8 @@
#include <openssl/x509.h>
#include "crypto/x509.h"
DEFINE_STACK_OF(X509_ATTRIBUTE)
/*-
* X509_REQ_INFO is handled in an unusual way to get round
* invalid encodings. Some broken certificate requests don't
+3 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -15,6 +15,8 @@
#include <openssl/x509v3.h>
#include "crypto/x509.h"
DEFINE_STACK_OF(IPAddressFamily)
ASN1_SEQUENCE_enc(X509_CINF, enc, 0) = {
ASN1_EXP_OPT(X509_CINF, version, ASN1_INTEGER, 0),
ASN1_EMBED(X509_CINF, serialNumber, ASN1_INTEGER),
+2
View File
@@ -14,6 +14,8 @@
#include <openssl/x509.h>
#include "crypto/x509.h"
DEFINE_STACK_OF(ASN1_OBJECT)
/*
* X509_CERT_AUX routines. These are used to encode additional user
* modifiable data about a certificate. This data is appended to the X509