Trim unused declarations in pem.h.

None of these declarations are ever defined or constants used.

Change-Id: Id71ed5f02f9972d375845eacd9ce290a64b1c525
Reviewed-on: https://boringssl-review.googlesource.com/17024
Commit-Queue: Steven Valdez <svaldez@google.com>
Reviewed-by: Steven Valdez <svaldez@google.com>
CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
This commit is contained in:
David Benjamin 2016-12-23 19:31:03 -05:00 committed by CQ bot account: commit-bot@chromium.org
parent 3b33f3eb2d
commit 42adba5173

View File

@ -76,41 +76,6 @@ extern "C" {
#define PEM_BUFSIZE 1024 #define PEM_BUFSIZE 1024
#define PEM_OBJ_UNDEF 0
#define PEM_OBJ_X509 1
#define PEM_OBJ_X509_REQ 2
#define PEM_OBJ_CRL 3
#define PEM_OBJ_SSL_SESSION 4
#define PEM_OBJ_PRIV_KEY 10
#define PEM_OBJ_PRIV_RSA 11
#define PEM_OBJ_PRIV_DSA 12
#define PEM_OBJ_PRIV_DH 13
#define PEM_OBJ_PUB_RSA 14
#define PEM_OBJ_PUB_DSA 15
#define PEM_OBJ_PUB_DH 16
#define PEM_OBJ_DHPARAMS 17
#define PEM_OBJ_DSAPARAMS 18
#define PEM_OBJ_PRIV_RSA_PUBLIC 19
#define PEM_OBJ_PRIV_ECDSA 20
#define PEM_OBJ_PUB_ECDSA 21
#define PEM_OBJ_ECPARAMETERS 22
#define PEM_ERROR 30
#define PEM_DEK_DES_CBC 40
#define PEM_DEK_IDEA_CBC 45
#define PEM_DEK_DES_EDE 50
#define PEM_DEK_DES_ECB 60
#define PEM_DEK_RSA 70
#define PEM_DEK_RSA_MD2 80
#define PEM_DEK_RSA_MD5 90
#define PEM_MD_MD2 NID_md2
#define PEM_MD_MD5 NID_md5
#define PEM_MD_SHA NID_sha
#define PEM_MD_MD2_RSA NID_md2WithRSAEncryption
#define PEM_MD_MD5_RSA NID_md5WithRSAEncryption
#define PEM_MD_SHA_RSA NID_sha1WithRSAEncryption
#define PEM_STRING_X509_OLD "X509 CERTIFICATE" #define PEM_STRING_X509_OLD "X509 CERTIFICATE"
#define PEM_STRING_X509 "CERTIFICATE" #define PEM_STRING_X509 "CERTIFICATE"
#define PEM_STRING_X509_PAIR "CERTIFICATE PAIR" #define PEM_STRING_X509_PAIR "CERTIFICATE PAIR"
@ -136,71 +101,12 @@ extern "C" {
#define PEM_STRING_ECPRIVATEKEY "EC PRIVATE KEY" #define PEM_STRING_ECPRIVATEKEY "EC PRIVATE KEY"
#define PEM_STRING_CMS "CMS" #define PEM_STRING_CMS "CMS"
/* Note that this structure is initialised by PEM_SealInit and cleaned up
by PEM_SealFinal (at least for now) */
typedef struct PEM_Encode_Seal_st
{
EVP_ENCODE_CTX encode;
EVP_MD_CTX md;
EVP_CIPHER_CTX cipher;
} PEM_ENCODE_SEAL_CTX;
/* enc_type is one off */ /* enc_type is one off */
#define PEM_TYPE_ENCRYPTED 10 #define PEM_TYPE_ENCRYPTED 10
#define PEM_TYPE_MIC_ONLY 20 #define PEM_TYPE_MIC_ONLY 20
#define PEM_TYPE_MIC_CLEAR 30 #define PEM_TYPE_MIC_CLEAR 30
#define PEM_TYPE_CLEAR 40 #define PEM_TYPE_CLEAR 40
typedef struct pem_recip_st
{
char *name;
X509_NAME *dn;
int cipher;
int key_enc;
/* char iv[8]; unused and wrong size */
} PEM_USER;
typedef struct pem_ctx_st
{
int type; /* what type of object */
struct {
int version;
int mode;
} proc_type;
char *domain;
struct {
int cipher;
/* unused, and wrong size
unsigned char iv[8]; */
} DEK_info;
PEM_USER *originator;
int num_recipient;
PEM_USER **recipient;
EVP_MD *md; /* signature type */
int md_enc; /* is the md encrypted or not? */
int md_len; /* length of md_data */
char *md_data; /* message digest, could be pkey encrypted */
EVP_CIPHER *dec; /* date encryption cipher */
int key_len; /* key length */
unsigned char *key; /* key */
/* unused, and wrong size
unsigned char iv[8]; */
int data_enc; /* is the data encrypted */
int data_len;
unsigned char *data;
} PEM_CTX;
/* These macros make the PEM_read/PEM_write functions easier to maintain and /* These macros make the PEM_read/PEM_write functions easier to maintain and
* write. Now they are all implemented with either: * write. Now they are all implemented with either:
* IMPLEMENT_PEM_rw(...) or IMPLEMENT_PEM_rw_cb(...) * IMPLEMENT_PEM_rw(...) or IMPLEMENT_PEM_rw_cb(...)
@ -404,14 +310,6 @@ OPENSSL_EXPORT void * PEM_ASN1_read(d2i_of_void *d2i, const char *name, FILE *f
OPENSSL_EXPORT int PEM_ASN1_write(i2d_of_void *i2d,const char *name,FILE *fp, void *x,const EVP_CIPHER *enc,unsigned char *kstr, int klen,pem_password_cb *callback, void *u); OPENSSL_EXPORT int PEM_ASN1_write(i2d_of_void *i2d,const char *name,FILE *fp, void *x,const EVP_CIPHER *enc,unsigned char *kstr, int klen,pem_password_cb *callback, void *u);
OPENSSL_EXPORT STACK_OF(X509_INFO) * PEM_X509_INFO_read(FILE *fp, STACK_OF(X509_INFO) *sk, pem_password_cb *cb, void *u); OPENSSL_EXPORT STACK_OF(X509_INFO) * PEM_X509_INFO_read(FILE *fp, STACK_OF(X509_INFO) *sk, pem_password_cb *cb, void *u);
OPENSSL_EXPORT int PEM_SealInit(PEM_ENCODE_SEAL_CTX *ctx, EVP_CIPHER *type, EVP_MD *md_type, unsigned char **ek, int *ekl, unsigned char *iv, EVP_PKEY **pubk, int npubk);
OPENSSL_EXPORT void PEM_SealUpdate(PEM_ENCODE_SEAL_CTX *ctx, unsigned char *out, int *outl, unsigned char *in, int inl);
OPENSSL_EXPORT int PEM_SealFinal(PEM_ENCODE_SEAL_CTX *ctx, unsigned char *sig,int *sigl, unsigned char *out, int *outl, EVP_PKEY *priv);
OPENSSL_EXPORT void PEM_SignInit(EVP_MD_CTX *ctx, EVP_MD *type);
OPENSSL_EXPORT void PEM_SignUpdate(EVP_MD_CTX *ctx,unsigned char *d,unsigned int cnt);
OPENSSL_EXPORT int PEM_SignFinal(EVP_MD_CTX *ctx, unsigned char *sigret, unsigned int *siglen, EVP_PKEY *pkey);
/* PEM_def_callback treats |userdata| as a string and copies it into |buf|, /* PEM_def_callback treats |userdata| as a string and copies it into |buf|,
* assuming its |size| is sufficient. Returns the length of the string, or 0 * assuming its |size| is sufficient. Returns the length of the string, or 0
* if there is not enough room. If either |buf| or |userdata| is NULL, 0 is * if there is not enough room. If either |buf| or |userdata| is NULL, 0 is
@ -433,10 +331,6 @@ DECLARE_PEM_write(X509_REQ_NEW, X509_REQ)
DECLARE_PEM_rw(X509_CRL, X509_CRL) DECLARE_PEM_rw(X509_CRL, X509_CRL)
/* DECLARE_PEM_rw(PKCS7, PKCS7) */
DECLARE_PEM_rw(NETSCAPE_CERT_SEQUENCE, NETSCAPE_CERT_SEQUENCE)
DECLARE_PEM_rw(PKCS8, X509_SIG) DECLARE_PEM_rw(PKCS8, X509_SIG)
DECLARE_PEM_rw(PKCS8_PRIV_KEY_INFO, PKCS8_PRIV_KEY_INFO) DECLARE_PEM_rw(PKCS8_PRIV_KEY_INFO, PKCS8_PRIV_KEY_INFO)
@ -481,18 +375,6 @@ OPENSSL_EXPORT EVP_PKEY *d2i_PKCS8PrivateKey_fp(FILE *fp, EVP_PKEY **x, pem_pass
OPENSSL_EXPORT int PEM_write_PKCS8PrivateKey(FILE *fp,EVP_PKEY *x,const EVP_CIPHER *enc, char *kstr,int klen, pem_password_cb *cd, void *u); OPENSSL_EXPORT int PEM_write_PKCS8PrivateKey(FILE *fp,EVP_PKEY *x,const EVP_CIPHER *enc, char *kstr,int klen, pem_password_cb *cd, void *u);
OPENSSL_EXPORT EVP_PKEY *b2i_PrivateKey(const unsigned char **in, long length);
OPENSSL_EXPORT EVP_PKEY *b2i_PublicKey(const unsigned char **in, long length);
OPENSSL_EXPORT EVP_PKEY *b2i_PrivateKey_bio(BIO *in);
OPENSSL_EXPORT EVP_PKEY *b2i_PublicKey_bio(BIO *in);
OPENSSL_EXPORT int i2b_PrivateKey_bio(BIO *out, EVP_PKEY *pk);
OPENSSL_EXPORT int i2b_PublicKey_bio(BIO *out, EVP_PKEY *pk);
OPENSSL_EXPORT EVP_PKEY *b2i_PVK_bio(BIO *in, pem_password_cb *cb, void *u);
OPENSSL_EXPORT int i2b_PVK_bio(BIO *out, EVP_PKEY *pk, int enclevel, pem_password_cb *cb, void *u);
void ERR_load_PEM_strings(void);
#ifdef __cplusplus #ifdef __cplusplus
} }