summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/asn1/asn1_locl.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/asn1/asn1_locl.h')
-rw-r--r--src/lib/libcrypto/asn1/asn1_locl.h43
1 files changed, 18 insertions, 25 deletions
diff --git a/src/lib/libcrypto/asn1/asn1_locl.h b/src/lib/libcrypto/asn1/asn1_locl.h
index 64bf8ec2fa..bcbb605202 100644
--- a/src/lib/libcrypto/asn1/asn1_locl.h
+++ b/src/lib/libcrypto/asn1/asn1_locl.h
@@ -10,7 +10,7 @@
10 * are met: 10 * are met:
11 * 11 *
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 14 *
15 * 2. Redistributions in binary form must reproduce the above copyright 15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in 16 * notice, this list of conditions and the following disclaimer in
@@ -60,8 +60,7 @@
60 60
61/* ASN1 print context structure */ 61/* ASN1 print context structure */
62 62
63struct asn1_pctx_st 63struct asn1_pctx_st {
64{
65 unsigned long flags; 64 unsigned long flags;
66 unsigned long nm_flags; 65 unsigned long nm_flags;
67 unsigned long cert_flags; 66 unsigned long cert_flags;
@@ -71,8 +70,7 @@ struct asn1_pctx_st
71 70
72/* ASN1 public key method structure */ 71/* ASN1 public key method structure */
73 72
74struct evp_pkey_asn1_method_st 73struct evp_pkey_asn1_method_st {
75{
76 int pkey_id; 74 int pkey_id;
77 int pkey_base_id; 75 int pkey_base_id;
78 unsigned long pkey_flags; 76 unsigned long pkey_flags;
@@ -84,44 +82,40 @@ struct evp_pkey_asn1_method_st
84 int (*pub_encode)(X509_PUBKEY *pub, const EVP_PKEY *pk); 82 int (*pub_encode)(X509_PUBKEY *pub, const EVP_PKEY *pk);
85 int (*pub_cmp)(const EVP_PKEY *a, const EVP_PKEY *b); 83 int (*pub_cmp)(const EVP_PKEY *a, const EVP_PKEY *b);
86 int (*pub_print)(BIO *out, const EVP_PKEY *pkey, int indent, 84 int (*pub_print)(BIO *out, const EVP_PKEY *pkey, int indent,
87 ASN1_PCTX *pctx); 85 ASN1_PCTX *pctx);
88 86
89 int (*priv_decode)(EVP_PKEY *pk, PKCS8_PRIV_KEY_INFO *p8inf); 87 int (*priv_decode)(EVP_PKEY *pk, PKCS8_PRIV_KEY_INFO *p8inf);
90 int (*priv_encode)(PKCS8_PRIV_KEY_INFO *p8, const EVP_PKEY *pk); 88 int (*priv_encode)(PKCS8_PRIV_KEY_INFO *p8, const EVP_PKEY *pk);
91 int (*priv_print)(BIO *out, const EVP_PKEY *pkey, int indent, 89 int (*priv_print)(BIO *out, const EVP_PKEY *pkey, int indent,
92 ASN1_PCTX *pctx); 90 ASN1_PCTX *pctx);
93 91
94 int (*pkey_size)(const EVP_PKEY *pk); 92 int (*pkey_size)(const EVP_PKEY *pk);
95 int (*pkey_bits)(const EVP_PKEY *pk); 93 int (*pkey_bits)(const EVP_PKEY *pk);
96 94
97 int (*param_decode)(EVP_PKEY *pkey, 95 int (*param_decode)(EVP_PKEY *pkey, const unsigned char **pder,
98 const unsigned char **pder, int derlen); 96 int derlen);
99 int (*param_encode)(const EVP_PKEY *pkey, unsigned char **pder); 97 int (*param_encode)(const EVP_PKEY *pkey, unsigned char **pder);
100 int (*param_missing)(const EVP_PKEY *pk); 98 int (*param_missing)(const EVP_PKEY *pk);
101 int (*param_copy)(EVP_PKEY *to, const EVP_PKEY *from); 99 int (*param_copy)(EVP_PKEY *to, const EVP_PKEY *from);
102 int (*param_cmp)(const EVP_PKEY *a, const EVP_PKEY *b); 100 int (*param_cmp)(const EVP_PKEY *a, const EVP_PKEY *b);
103 int (*param_print)(BIO *out, const EVP_PKEY *pkey, int indent, 101 int (*param_print)(BIO *out, const EVP_PKEY *pkey, int indent,
104 ASN1_PCTX *pctx); 102 ASN1_PCTX *pctx);
105 int (*sig_print)(BIO *out, 103 int (*sig_print)(BIO *out, const X509_ALGOR *sigalg,
106 const X509_ALGOR *sigalg, const ASN1_STRING *sig, 104 const ASN1_STRING *sig, int indent, ASN1_PCTX *pctx);
107 int indent, ASN1_PCTX *pctx);
108
109 105
110 void (*pkey_free)(EVP_PKEY *pkey); 106 void (*pkey_free)(EVP_PKEY *pkey);
111 int (*pkey_ctrl)(EVP_PKEY *pkey, int op, long arg1, void *arg2); 107 int (*pkey_ctrl)(EVP_PKEY *pkey, int op, long arg1, void *arg2);
112 108
113 /* Legacy functions for old PEM */ 109 /* Legacy functions for old PEM */
114 110
115 int (*old_priv_decode)(EVP_PKEY *pkey, 111 int (*old_priv_decode)(EVP_PKEY *pkey, const unsigned char **pder,
116 const unsigned char **pder, int derlen); 112 int derlen);
117 int (*old_priv_encode)(const EVP_PKEY *pkey, unsigned char **pder); 113 int (*old_priv_encode)(const EVP_PKEY *pkey, unsigned char **pder);
118 /* Custom ASN1 signature verification */ 114 /* Custom ASN1 signature verification */
119 int (*item_verify)(EVP_MD_CTX *ctx, const ASN1_ITEM *it, void *asn, 115 int (*item_verify)(EVP_MD_CTX *ctx, const ASN1_ITEM *it, void *asn,
120 X509_ALGOR *a, ASN1_BIT_STRING *sig, 116 X509_ALGOR *a, ASN1_BIT_STRING *sig, EVP_PKEY *pkey);
121 EVP_PKEY *pkey);
122 int (*item_sign)(EVP_MD_CTX *ctx, const ASN1_ITEM *it, void *asn, 117 int (*item_sign)(EVP_MD_CTX *ctx, const ASN1_ITEM *it, void *asn,
123 X509_ALGOR *alg1, X509_ALGOR *alg2, 118 X509_ALGOR *alg1, X509_ALGOR *alg2, ASN1_BIT_STRING *sig);
124 ASN1_BIT_STRING *sig);
125 119
126} /* EVP_PKEY_ASN1_METHOD */; 120} /* EVP_PKEY_ASN1_METHOD */;
127 121
@@ -134,13 +128,12 @@ struct evp_pkey_asn1_method_st
134 128
135#define X509_CRL_METHOD_DYNAMIC 1 129#define X509_CRL_METHOD_DYNAMIC 1
136 130
137struct x509_crl_method_st 131struct x509_crl_method_st {
138{
139 int flags; 132 int flags;
140 int (*crl_init)(X509_CRL *crl); 133 int (*crl_init)(X509_CRL *crl);
141 int (*crl_free)(X509_CRL *crl); 134 int (*crl_free)(X509_CRL *crl);
142 int (*crl_lookup)(X509_CRL *crl, X509_REVOKED **ret, 135 int (*crl_lookup)(X509_CRL *crl, X509_REVOKED **ret,
143 ASN1_INTEGER *ser, X509_NAME *issuer); 136 ASN1_INTEGER *ser, X509_NAME *issuer);
144 int (*crl_verify)(X509_CRL *crl, EVP_PKEY *pk); 137 int (*crl_verify)(X509_CRL *crl, EVP_PKEY *pk);
145}; 138};
146 139
@@ -154,5 +147,5 @@ struct x509_crl_method_st
154#define UNICODE_IS_SURROGATE(x) \ 147#define UNICODE_IS_SURROGATE(x) \
155 ((x) >= UNICODE_SURROGATE_MIN && (x) <= UNICODE_SURROGATE_MAX) 148 ((x) >= UNICODE_SURROGATE_MIN && (x) <= UNICODE_SURROGATE_MAX)
156 149
157int UTF8_getc(const unsigned char *str, int len, unsigned long *val); 150int UTF8_getc(const unsigned char *str, int len, unsigned long *val);
158int UTF8_putc(unsigned char *str, int len, unsigned long value); 151int UTF8_putc(unsigned char *str, int len, unsigned long value);