Skip to content

Commit

Permalink
Delete some dead code from crypto/x509.
Browse files Browse the repository at this point in the history
These are never referenced within the library or externally. Some of the
constants have been unused since SSLeay.

Change-Id: I597511208dab1ab3816e5f730fcadaea9a733dff
Reviewed-on: https://boringssl-review.googlesource.com/17025
Reviewed-by: Adam Langley <[email protected]>
Commit-Queue: David Benjamin <[email protected]>
  • Loading branch information
davidben committed Jun 9, 2017
1 parent 5e61d53 commit 2dfa1ba
Show file tree
Hide file tree
Showing 11 changed files with 0 additions and 245 deletions.
2 changes: 0 additions & 2 deletions crypto/pem/pem_xaux.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,3 @@
#include <openssl/x509.h>

IMPLEMENT_PEM_rw(X509_AUX, X509, PEM_STRING_X509_TRUSTED, X509_AUX)
IMPLEMENT_PEM_rw(X509_CERT_PAIR, X509_CERT_PAIR, PEM_STRING_X509_PAIR,
X509_CERT_PAIR)
1 change: 0 additions & 1 deletion crypto/x509/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ add_library(
x509name.c
x509rset.c
x509spki.c
x509type.c
x_algor.c
x_all.c
x_attrib.c
Expand Down
6 changes: 0 additions & 6 deletions crypto/x509/x509_vfy.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,6 @@ static int null_callback(int ok, X509_STORE_CTX *e)
return ok;
}

#if 0
static int x509_subject_cmp(X509 **a, X509 **b)
{
return X509_subject_name_cmp(*a, *b);
}
#endif
/* Return 1 is a certificate is self signed */
static int cert_self_signed(X509 *x)
{
Expand Down
126 changes: 0 additions & 126 deletions crypto/x509/x509type.c

This file was deleted.

7 changes: 0 additions & 7 deletions crypto/x509/x_x509a.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,3 @@ void X509_reject_clear(X509 *x)
x->aux->reject = NULL;
}
}

ASN1_SEQUENCE(X509_CERT_PAIR) = {
ASN1_EXP_OPT(X509_CERT_PAIR, forward, X509, 0),
ASN1_EXP_OPT(X509_CERT_PAIR, reverse, X509, 1)
} ASN1_SEQUENCE_END(X509_CERT_PAIR)

IMPLEMENT_ASN1_FUNCTIONS(X509_CERT_PAIR)
9 changes: 0 additions & 9 deletions crypto/x509v3/pcy_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,15 +137,6 @@ const ASN1_OBJECT *X509_policy_node_get0_policy(const X509_POLICY_NODE *node)
return node->data->valid_policy;
}

#if 0
int X509_policy_node_get_critical(const X509_POLICY_NODE *node)
{
if (node_critical(node))
return 1;
return 0;
}
#endif

STACK_OF(POLICYQUALINFO) *X509_policy_node_get0_qualifiers(const
X509_POLICY_NODE
*node)
Expand Down
3 changes: 0 additions & 3 deletions include/openssl/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,6 @@ typedef struct DIST_POINT_st DIST_POINT;
typedef struct DSA_SIG_st DSA_SIG;
typedef struct ISSUING_DIST_POINT_st ISSUING_DIST_POINT;
typedef struct NAME_CONSTRAINTS_st NAME_CONSTRAINTS;
typedef struct Netscape_certificate_sequence NETSCAPE_CERT_SEQUENCE;
typedef struct Netscape_spkac_st NETSCAPE_SPKAC;
typedef struct Netscape_spki_st NETSCAPE_SPKI;
typedef struct RIPEMD160state_st RIPEMD160_CTX;
Expand All @@ -264,7 +263,6 @@ typedef struct X509_extension_st X509_EXTENSION;
typedef struct X509_info_st X509_INFO;
typedef struct X509_name_entry_st X509_NAME_ENTRY;
typedef struct X509_name_st X509_NAME;
typedef struct X509_objects_st X509_OBJECTS;
typedef struct X509_pubkey_st X509_PUBKEY;
typedef struct X509_req_info_st X509_REQ_INFO;
typedef struct X509_req_st X509_REQ;
Expand Down Expand Up @@ -329,7 +327,6 @@ typedef struct st_ERR_FNS ERR_FNS;
typedef struct v3_ext_ctx X509V3_CTX;
typedef struct x509_attributes_st X509_ATTRIBUTE;
typedef struct x509_cert_aux_st X509_CERT_AUX;
typedef struct x509_cert_pair_st X509_CERT_PAIR;
typedef struct x509_cinf_st X509_CINF;
typedef struct x509_crl_method_st X509_CRL_METHOD;
typedef struct x509_lookup_st X509_LOOKUP;
Expand Down
2 changes: 0 additions & 2 deletions include/openssl/pem.h
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,6 @@ DECLARE_PEM_rw(X509, X509)

DECLARE_PEM_rw(X509_AUX, X509)

DECLARE_PEM_rw(X509_CERT_PAIR, X509_CERT_PAIR)

DECLARE_PEM_rw(X509_REQ, X509_REQ)
DECLARE_PEM_write(X509_REQ_NEW, X509_REQ)

Expand Down
65 changes: 0 additions & 65 deletions include/openssl/x509.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,6 @@ extern "C" {
#define X509v3_KU_DECIPHER_ONLY 0x8000
#define X509v3_KU_UNDEF 0xffff

struct X509_objects_st
{
int nid;
int (*a2i)(void);
int (*i2a)(void);
} /* X509_OBJECTS */;

DEFINE_STACK_OF(X509_ALGOR)
DECLARE_ASN1_SET_OF(X509_ALGOR)

Expand Down Expand Up @@ -159,20 +152,14 @@ struct X509_name_st
{
STACK_OF(X509_NAME_ENTRY) *entries;
int modified; /* true if 'bytes' needs to be built */
#ifndef OPENSSL_NO_BUFFER
BUF_MEM *bytes;
#else
char *bytes;
#endif
/* unsigned long hash; Keep the hash around for lookups */
unsigned char *canon_enc;
int canon_enclen;
} /* X509_NAME */;

DEFINE_STACK_OF(X509_NAME)

#define X509_EX_V_NETSCAPE_HACK 0x8000
#define X509_EX_V_INIT 0x0001
struct X509_extension_st
{
ASN1_OBJECT *object;
Expand Down Expand Up @@ -295,11 +282,6 @@ struct x509_trust_st {

DEFINE_STACK_OF(X509_TRUST)

struct x509_cert_pair_st {
X509 *forward;
X509 *reverse;
} /* X509_CERT_PAIR */;

/* standard trust ids */

#define X509_TRUST_DEFAULT (-1) /* Only valid in purpose settings */
Expand Down Expand Up @@ -510,20 +492,6 @@ struct Netscape_spki_st
ASN1_BIT_STRING *signature;
} /* NETSCAPE_SPKI */;

/* Netscape certificate sequence structure */
struct Netscape_certificate_sequence
{
ASN1_OBJECT *type;
STACK_OF(X509) *certs;
} /* NETSCAPE_CERT_SEQUENCE */;

/* Unused (and iv length is wrong)
typedef struct CBCParameter_st
{
unsigned char iv[8];
} CBC_PARAM;
*/

/* PKCS#8 private key info structure */

struct pkcs8_priv_key_info_st
Expand All @@ -550,9 +518,6 @@ struct pkcs8_priv_key_info_st
extern "C" {
#endif

#define X509_EXT_PACK_UNKNOWN 1
#define X509_EXT_PACK_STRING 2

#define X509_get_version(x) ASN1_INTEGER_get((x)->cert_info->version)
/* #define X509_get_serialNumber(x) ((x)->cert_info->serialNumber) */
#define X509_get_notBefore(x) ((x)->cert_info->validity->notBefore)
Expand Down Expand Up @@ -781,8 +746,6 @@ DECLARE_ASN1_FUNCTIONS(X509_CINF)
DECLARE_ASN1_FUNCTIONS(X509)
DECLARE_ASN1_FUNCTIONS(X509_CERT_AUX)

DECLARE_ASN1_FUNCTIONS(X509_CERT_PAIR)

/* X509_up_ref adds one to the reference count of |x| and returns one. */
OPENSSL_EXPORT int X509_up_ref(X509 *x);

Expand Down Expand Up @@ -822,7 +785,6 @@ OPENSSL_EXPORT void X509_PKEY_free(X509_PKEY *a);

DECLARE_ASN1_FUNCTIONS(NETSCAPE_SPKI)
DECLARE_ASN1_FUNCTIONS(NETSCAPE_SPKAC)
DECLARE_ASN1_FUNCTIONS(NETSCAPE_CERT_SEQUENCE)

#ifndef OPENSSL_NO_EVP
OPENSSL_EXPORT X509_INFO * X509_INFO_new(void);
Expand Down Expand Up @@ -858,7 +820,6 @@ OPENSSL_EXPORT int X509_set_notAfter(X509 *x, const ASN1_TIME *tm);
OPENSSL_EXPORT int X509_set_pubkey(X509 *x, EVP_PKEY *pkey);
OPENSSL_EXPORT EVP_PKEY * X509_get_pubkey(X509 *x);
OPENSSL_EXPORT ASN1_BIT_STRING * X509_get0_pubkey_bitstr(const X509 *x);
OPENSSL_EXPORT int X509_certificate_type(X509 *x,EVP_PKEY *pubkey /* optional */);
OPENSSL_EXPORT STACK_OF(X509_EXTENSION) *X509_get0_extensions(const X509 *x);

OPENSSL_EXPORT int X509_REQ_set_version(X509_REQ *x,long version);
Expand Down Expand Up @@ -1130,32 +1091,6 @@ typedef struct rsa_pss_params_st {
DECLARE_ASN1_FUNCTIONS(RSA_PSS_PARAMS)


/* EVP_PK values indicate the algorithm of the public key in a certificate. */

#define EVP_PK_RSA 0x0001
#define EVP_PK_DSA 0x0002
#define EVP_PK_DH 0x0004
#define EVP_PK_EC 0x0008

/* EVP_PKS values indicate the algorithm used to sign a certificate. */

#define EVP_PKS_RSA 0x0100
#define EVP_PKS_DSA 0x0200
#define EVP_PKS_EC 0x0400

/* EVP_PKT values are flags that define what public-key operations can be
* performed with the public key from a certificate. */

/* EVP_PKT_SIGN indicates that the public key can be used for signing. */
#define EVP_PKT_SIGN 0x0010
/* EVP_PKT_ENC indicates that a session key can be encrypted to the public
* key. */
#define EVP_PKT_ENC 0x0020
/* EVP_PKT_EXCH indicates that key-agreement can be performed. */
#define EVP_PKT_EXCH 0x0040
/* EVP_PKT_EXP indicates that key is weak (i.e. "export"). */
#define EVP_PKT_EXP 0x1000


#ifdef __cplusplus
}
Expand Down
23 changes: 0 additions & 23 deletions include/openssl/x509_vfy.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,25 +80,6 @@ extern "C" {
* dependencies on this header where possible. */


#if 0
/* Outer object */
typedef struct x509_hash_dir_st
{
int num_dirs;
char **dirs;
int *dirs_type;
int num_dirs_alloced;
} X509_HASH_DIR_CTX;
#endif

typedef struct x509_file_st
{
int num_paths; /* number of paths to files or directories */
int num_alloced;
char **paths; /* the list of paths or directories */
int *path_type;
} X509_CERT_FILE_CTX;

/*******************************/
/*
SSL_CTX -> X509_STORE
Expand All @@ -117,10 +98,6 @@ The X509_STORE then calls a function to actually verify the
certificate chain.
*/

/* The following are legacy constants that should not be used. */
#define X509_LU_RETRY (-1)
#define X509_LU_FAIL 0

#define X509_LU_X509 1
#define X509_LU_CRL 2
#define X509_LU_PKEY 3
Expand Down
1 change: 0 additions & 1 deletion include/openssl/x509v3.h
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,6 @@ DEFINE_STACK_OF(X509_POLICY_NODE)
/* The following lines are auto generated by the script mkerr.pl. Any changes
* made after this point may be overwritten when the script is next run.
*/
void ERR_load_X509V3_strings(void);


#ifdef __cplusplus
Expand Down

0 comments on commit 2dfa1ba

Please sign in to comment.