diff options
author | djm <> | 2012-10-13 21:23:50 +0000 |
---|---|---|
committer | djm <> | 2012-10-13 21:23:50 +0000 |
commit | e9d65189905c6e99c1062d65e26bf83eebb0a26a (patch) | |
tree | 10ebe51c3542099b0ab8325d8f322372375dc3b4 /src/lib/libcrypto/asn1 | |
parent | 59625e84c89bf82e1c6d20c55785b618eb56ea72 (diff) | |
parent | 228cae30b117c2493f69ad3c195341cd6ec8d430 (diff) | |
download | openbsd-e9d65189905c6e99c1062d65e26bf83eebb0a26a.tar.gz openbsd-e9d65189905c6e99c1062d65e26bf83eebb0a26a.tar.bz2 openbsd-e9d65189905c6e99c1062d65e26bf83eebb0a26a.zip |
This commit was generated by cvs2git to track changes on a CVS vendor
branch.
Diffstat (limited to 'src/lib/libcrypto/asn1')
-rw-r--r-- | src/lib/libcrypto/asn1/ameth_lib.c | 12 | ||||
-rw-r--r-- | src/lib/libcrypto/asn1/asn1_locl.h | 11 |
2 files changed, 22 insertions, 1 deletions
diff --git a/src/lib/libcrypto/asn1/ameth_lib.c b/src/lib/libcrypto/asn1/ameth_lib.c index 5a581b90ea..a19e058fca 100644 --- a/src/lib/libcrypto/asn1/ameth_lib.c +++ b/src/lib/libcrypto/asn1/ameth_lib.c | |||
@@ -69,6 +69,7 @@ extern const EVP_PKEY_ASN1_METHOD dsa_asn1_meths[]; | |||
69 | extern const EVP_PKEY_ASN1_METHOD dh_asn1_meth; | 69 | extern const EVP_PKEY_ASN1_METHOD dh_asn1_meth; |
70 | extern const EVP_PKEY_ASN1_METHOD eckey_asn1_meth; | 70 | extern const EVP_PKEY_ASN1_METHOD eckey_asn1_meth; |
71 | extern const EVP_PKEY_ASN1_METHOD hmac_asn1_meth; | 71 | extern const EVP_PKEY_ASN1_METHOD hmac_asn1_meth; |
72 | extern const EVP_PKEY_ASN1_METHOD cmac_asn1_meth; | ||
72 | 73 | ||
73 | /* Keep this sorted in type order !! */ | 74 | /* Keep this sorted in type order !! */ |
74 | static const EVP_PKEY_ASN1_METHOD *standard_methods[] = | 75 | static const EVP_PKEY_ASN1_METHOD *standard_methods[] = |
@@ -90,7 +91,8 @@ static const EVP_PKEY_ASN1_METHOD *standard_methods[] = | |||
90 | #ifndef OPENSSL_NO_EC | 91 | #ifndef OPENSSL_NO_EC |
91 | &eckey_asn1_meth, | 92 | &eckey_asn1_meth, |
92 | #endif | 93 | #endif |
93 | &hmac_asn1_meth | 94 | &hmac_asn1_meth, |
95 | &cmac_asn1_meth | ||
94 | }; | 96 | }; |
95 | 97 | ||
96 | typedef int sk_cmp_fn_type(const char * const *a, const char * const *b); | 98 | typedef int sk_cmp_fn_type(const char * const *a, const char * const *b); |
@@ -291,6 +293,8 @@ EVP_PKEY_ASN1_METHOD* EVP_PKEY_asn1_new(int id, int flags, | |||
291 | if (!ameth) | 293 | if (!ameth) |
292 | return NULL; | 294 | return NULL; |
293 | 295 | ||
296 | memset(ameth, 0, sizeof(EVP_PKEY_ASN1_METHOD)); | ||
297 | |||
294 | ameth->pkey_id = id; | 298 | ameth->pkey_id = id; |
295 | ameth->pkey_base_id = id; | 299 | ameth->pkey_base_id = id; |
296 | ameth->pkey_flags = flags | ASN1_PKEY_DYNAMIC; | 300 | ameth->pkey_flags = flags | ASN1_PKEY_DYNAMIC; |
@@ -325,6 +329,9 @@ EVP_PKEY_ASN1_METHOD* EVP_PKEY_asn1_new(int id, int flags, | |||
325 | ameth->old_priv_encode = 0; | 329 | ameth->old_priv_encode = 0; |
326 | ameth->old_priv_decode = 0; | 330 | ameth->old_priv_decode = 0; |
327 | 331 | ||
332 | ameth->item_verify = 0; | ||
333 | ameth->item_sign = 0; | ||
334 | |||
328 | ameth->pkey_size = 0; | 335 | ameth->pkey_size = 0; |
329 | ameth->pkey_bits = 0; | 336 | ameth->pkey_bits = 0; |
330 | 337 | ||
@@ -376,6 +383,9 @@ void EVP_PKEY_asn1_copy(EVP_PKEY_ASN1_METHOD *dst, | |||
376 | dst->pkey_free = src->pkey_free; | 383 | dst->pkey_free = src->pkey_free; |
377 | dst->pkey_ctrl = src->pkey_ctrl; | 384 | dst->pkey_ctrl = src->pkey_ctrl; |
378 | 385 | ||
386 | dst->item_sign = src->item_sign; | ||
387 | dst->item_verify = src->item_verify; | ||
388 | |||
379 | } | 389 | } |
380 | 390 | ||
381 | void EVP_PKEY_asn1_free(EVP_PKEY_ASN1_METHOD *ameth) | 391 | void EVP_PKEY_asn1_free(EVP_PKEY_ASN1_METHOD *ameth) |
diff --git a/src/lib/libcrypto/asn1/asn1_locl.h b/src/lib/libcrypto/asn1/asn1_locl.h index 5aa65e28f5..9fcf0d9530 100644 --- a/src/lib/libcrypto/asn1/asn1_locl.h +++ b/src/lib/libcrypto/asn1/asn1_locl.h | |||
@@ -102,6 +102,10 @@ struct evp_pkey_asn1_method_st | |||
102 | int (*param_cmp)(const EVP_PKEY *a, const EVP_PKEY *b); | 102 | int (*param_cmp)(const EVP_PKEY *a, const EVP_PKEY *b); |
103 | int (*param_print)(BIO *out, const EVP_PKEY *pkey, int indent, | 103 | int (*param_print)(BIO *out, const EVP_PKEY *pkey, int indent, |
104 | ASN1_PCTX *pctx); | 104 | ASN1_PCTX *pctx); |
105 | int (*sig_print)(BIO *out, | ||
106 | const X509_ALGOR *sigalg, const ASN1_STRING *sig, | ||
107 | int indent, ASN1_PCTX *pctx); | ||
108 | |||
105 | 109 | ||
106 | void (*pkey_free)(EVP_PKEY *pkey); | 110 | void (*pkey_free)(EVP_PKEY *pkey); |
107 | int (*pkey_ctrl)(EVP_PKEY *pkey, int op, long arg1, void *arg2); | 111 | int (*pkey_ctrl)(EVP_PKEY *pkey, int op, long arg1, void *arg2); |
@@ -111,6 +115,13 @@ struct evp_pkey_asn1_method_st | |||
111 | int (*old_priv_decode)(EVP_PKEY *pkey, | 115 | int (*old_priv_decode)(EVP_PKEY *pkey, |
112 | const unsigned char **pder, int derlen); | 116 | const unsigned char **pder, int derlen); |
113 | int (*old_priv_encode)(const EVP_PKEY *pkey, unsigned char **pder); | 117 | int (*old_priv_encode)(const EVP_PKEY *pkey, unsigned char **pder); |
118 | /* Custom ASN1 signature verification */ | ||
119 | int (*item_verify)(EVP_MD_CTX *ctx, const ASN1_ITEM *it, void *asn, | ||
120 | X509_ALGOR *a, ASN1_BIT_STRING *sig, | ||
121 | EVP_PKEY *pkey); | ||
122 | int (*item_sign)(EVP_MD_CTX *ctx, const ASN1_ITEM *it, void *asn, | ||
123 | X509_ALGOR *alg1, X509_ALGOR *alg2, | ||
124 | ASN1_BIT_STRING *sig); | ||
114 | 125 | ||
115 | } /* EVP_PKEY_ASN1_METHOD */; | 126 | } /* EVP_PKEY_ASN1_METHOD */; |
116 | 127 | ||