Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579
  1. /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
  2. * project 2006.
  3. */
  4. /* ====================================================================
  5. * Copyright (c) 2006 The OpenSSL Project. All rights reserved.
  6. *
  7. * Redistribution and use in source and binary forms, with or without
  8. * modification, are permitted provided that the following conditions
  9. * are met:
  10. *
  11. * 1. Redistributions of source code must retain the above copyright
  12. * notice, this list of conditions and the following disclaimer.
  13. *
  14. * 2. Redistributions in binary form must reproduce the above copyright
  15. * notice, this list of conditions and the following disclaimer in
  16. * the documentation and/or other materials provided with the
  17. * distribution.
  18. *
  19. * 3. All advertising materials mentioning features or use of this
  20. * software must display the following acknowledgment:
  21. * "This product includes software developed by the OpenSSL Project
  22. * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
  23. *
  24. * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
  25. * endorse or promote products derived from this software without
  26. * prior written permission. For written permission, please contact
  27. * licensing@OpenSSL.org.
  28. *
  29. * 5. Products derived from this software may not be called "OpenSSL"
  30. * nor may "OpenSSL" appear in their names without prior written
  31. * permission of the OpenSSL Project.
  32. *
  33. * 6. Redistributions of any form whatsoever must retain the following
  34. * acknowledgment:
  35. * "This product includes software developed by the OpenSSL Project
  36. * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
  37. *
  38. * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
  39. * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  40. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  41. * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
  42. * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  43. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  44. * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  45. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  46. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  47. * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  48. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
  49. * OF THE POSSIBILITY OF SUCH DAMAGE.
  50. * ====================================================================
  51. *
  52. * This product includes cryptographic software written by Eric Young
  53. * (eay@cryptsoft.com). This product includes software written by Tim
  54. * Hudson (tjh@cryptsoft.com). */
  55. #include <openssl/evp.h>
  56. #include <openssl/asn1t.h>
  57. #include <openssl/bn.h>
  58. #include <openssl/ec.h>
  59. #include <openssl/err.h>
  60. #include <openssl/mem.h>
  61. #include <openssl/obj.h>
  62. #include <openssl/x509.h>
  63. #include "internal.h"
  64. static int eckey_param2type(int *pptype, void **ppval, EC_KEY *ec_key) {
  65. const EC_GROUP *group;
  66. int nid;
  67. if (ec_key == NULL || (group = EC_KEY_get0_group(ec_key)) == NULL) {
  68. OPENSSL_PUT_ERROR(EVP, eckey_param2type, EVP_R_MISSING_PARAMETERS);
  69. return 0;
  70. }
  71. nid = EC_GROUP_get_curve_name(group);
  72. if (nid == NID_undef) {
  73. OPENSSL_PUT_ERROR(EVP, eckey_param2type, EVP_R_NO_NID_FOR_CURVE);
  74. return 0;
  75. }
  76. *ppval = (void*) OBJ_nid2obj(nid);
  77. *pptype = V_ASN1_OBJECT;
  78. return 1;
  79. }
  80. static int eckey_pub_encode(X509_PUBKEY *pk, const EVP_PKEY *pkey) {
  81. EC_KEY *ec_key = pkey->pkey.ec;
  82. void *pval = NULL;
  83. int ptype;
  84. uint8_t *penc = NULL, *p;
  85. int penclen;
  86. if (!eckey_param2type(&ptype, &pval, ec_key)) {
  87. OPENSSL_PUT_ERROR(EVP, eckey_pub_encode, ERR_R_EC_LIB);
  88. return 0;
  89. }
  90. penclen = i2o_ECPublicKey(ec_key, NULL);
  91. if (penclen <= 0) {
  92. goto err;
  93. }
  94. penc = OPENSSL_malloc(penclen);
  95. if (!penc) {
  96. goto err;
  97. }
  98. p = penc;
  99. penclen = i2o_ECPublicKey(ec_key, &p);
  100. if (penclen <= 0) {
  101. goto err;
  102. }
  103. if (X509_PUBKEY_set0_param(pk, OBJ_nid2obj(EVP_PKEY_EC), ptype, pval, penc,
  104. penclen)) {
  105. return 1;
  106. }
  107. err:
  108. if (ptype == V_ASN1_OBJECT) {
  109. ASN1_OBJECT_free(pval);
  110. } else {
  111. ASN1_STRING_free(pval);
  112. }
  113. if (penc) {
  114. OPENSSL_free(penc);
  115. }
  116. return 0;
  117. }
  118. static EC_KEY *eckey_type2param(int ptype, void *pval) {
  119. EC_KEY *eckey = NULL;
  120. if (ptype == V_ASN1_SEQUENCE) {
  121. ASN1_STRING *pstr = pval;
  122. const uint8_t *pm = pstr->data;
  123. int pmlen = pstr->length;
  124. eckey = d2i_ECParameters(NULL, &pm, pmlen);
  125. if (eckey == NULL) {
  126. OPENSSL_PUT_ERROR(EVP, eckey_type2param, EVP_R_DECODE_ERROR);
  127. goto err;
  128. }
  129. } else if (ptype == V_ASN1_OBJECT) {
  130. ASN1_OBJECT *poid = pval;
  131. EC_GROUP *group;
  132. /* type == V_ASN1_OBJECT => the parameters are given
  133. * by an asn1 OID */
  134. eckey = EC_KEY_new();
  135. if (eckey == NULL) {
  136. OPENSSL_PUT_ERROR(EVP, eckey_type2param, ERR_R_MALLOC_FAILURE);
  137. goto err;
  138. }
  139. group = EC_GROUP_new_by_curve_name(OBJ_obj2nid(poid));
  140. if (group == NULL) {
  141. goto err;
  142. }
  143. if (EC_KEY_set_group(eckey, group) == 0) {
  144. goto err;
  145. }
  146. EC_GROUP_free(group);
  147. } else {
  148. OPENSSL_PUT_ERROR(EVP, eckey_type2param, EVP_R_DECODE_ERROR);
  149. goto err;
  150. }
  151. return eckey;
  152. err:
  153. if (eckey) {
  154. EC_KEY_free(eckey);
  155. }
  156. return NULL;
  157. }
  158. static int eckey_pub_decode(EVP_PKEY *pkey, X509_PUBKEY *pubkey) {
  159. const uint8_t *p = NULL;
  160. void *pval;
  161. int ptype, pklen;
  162. EC_KEY *eckey = NULL;
  163. X509_ALGOR *palg;
  164. if (!X509_PUBKEY_get0_param(NULL, &p, &pklen, &palg, pubkey)) {
  165. return 0;
  166. }
  167. X509_ALGOR_get0(NULL, &ptype, &pval, palg);
  168. eckey = eckey_type2param(ptype, pval);
  169. if (!eckey) {
  170. OPENSSL_PUT_ERROR(EVP, eckey_pub_decode, ERR_R_EC_LIB);
  171. return 0;
  172. }
  173. /* We have parameters now set public key */
  174. if (!o2i_ECPublicKey(&eckey, &p, pklen)) {
  175. OPENSSL_PUT_ERROR(EVP, eckey_pub_decode, EVP_R_DECODE_ERROR);
  176. goto err;
  177. }
  178. EVP_PKEY_assign_EC_KEY(pkey, eckey);
  179. return 1;
  180. err:
  181. if (eckey)
  182. EC_KEY_free(eckey);
  183. return 0;
  184. }
  185. static int eckey_pub_cmp(const EVP_PKEY *a, const EVP_PKEY *b) {
  186. int r;
  187. const EC_GROUP *group = EC_KEY_get0_group(b->pkey.ec);
  188. const EC_POINT *pa = EC_KEY_get0_public_key(a->pkey.ec),
  189. *pb = EC_KEY_get0_public_key(b->pkey.ec);
  190. r = EC_POINT_cmp(group, pa, pb, NULL);
  191. if (r == 0) {
  192. return 1;
  193. } else if (r == 1) {
  194. return 0;
  195. } else {
  196. return -2;
  197. }
  198. }
  199. static int eckey_priv_decode(EVP_PKEY *pkey, PKCS8_PRIV_KEY_INFO *p8) {
  200. const uint8_t *p = NULL;
  201. void *pval;
  202. int ptype, pklen;
  203. EC_KEY *eckey = NULL;
  204. X509_ALGOR *palg;
  205. if (!PKCS8_pkey_get0(NULL, &p, &pklen, &palg, p8)) {
  206. return 0;
  207. }
  208. X509_ALGOR_get0(NULL, &ptype, &pval, palg);
  209. eckey = eckey_type2param(ptype, pval);
  210. if (!eckey)
  211. goto ecliberr;
  212. /* We have parameters now set private key */
  213. if (!d2i_ECPrivateKey(&eckey, &p, pklen)) {
  214. OPENSSL_PUT_ERROR(EVP, eckey_priv_decode, EVP_R_DECODE_ERROR);
  215. goto ecerr;
  216. }
  217. /* calculate public key (if necessary) */
  218. if (EC_KEY_get0_public_key(eckey) == NULL) {
  219. const BIGNUM *priv_key;
  220. const EC_GROUP *group;
  221. EC_POINT *pub_key;
  222. /* the public key was not included in the SEC1 private
  223. * key => calculate the public key */
  224. group = EC_KEY_get0_group(eckey);
  225. pub_key = EC_POINT_new(group);
  226. if (pub_key == NULL) {
  227. OPENSSL_PUT_ERROR(EVP, eckey_priv_decode, ERR_R_EC_LIB);
  228. goto ecliberr;
  229. }
  230. if (!EC_POINT_copy(pub_key, EC_GROUP_get0_generator(group))) {
  231. EC_POINT_free(pub_key);
  232. OPENSSL_PUT_ERROR(EVP, eckey_priv_decode, ERR_R_EC_LIB);
  233. goto ecliberr;
  234. }
  235. priv_key = EC_KEY_get0_private_key(eckey);
  236. if (!EC_POINT_mul(group, pub_key, priv_key, NULL, NULL, NULL)) {
  237. EC_POINT_free(pub_key);
  238. OPENSSL_PUT_ERROR(EVP, eckey_priv_decode, ERR_R_EC_LIB);
  239. goto ecliberr;
  240. }
  241. if (EC_KEY_set_public_key(eckey, pub_key) == 0) {
  242. EC_POINT_free(pub_key);
  243. OPENSSL_PUT_ERROR(EVP, eckey_priv_decode, ERR_R_EC_LIB);
  244. goto ecliberr;
  245. }
  246. EC_POINT_free(pub_key);
  247. }
  248. EVP_PKEY_assign_EC_KEY(pkey, eckey);
  249. return 1;
  250. ecliberr:
  251. OPENSSL_PUT_ERROR(EVP, eckey_priv_decode, ERR_R_EC_LIB);
  252. ecerr:
  253. if (eckey)
  254. EC_KEY_free(eckey);
  255. return 0;
  256. }
  257. static int eckey_priv_encode(PKCS8_PRIV_KEY_INFO *p8, const EVP_PKEY *pkey) {
  258. EC_KEY *ec_key;
  259. uint8_t *ep, *p;
  260. int eplen, ptype;
  261. void *pval;
  262. unsigned int tmp_flags, old_flags;
  263. ec_key = pkey->pkey.ec;
  264. if (!eckey_param2type(&ptype, &pval, ec_key)) {
  265. OPENSSL_PUT_ERROR(EVP, eckey_priv_encode, EVP_R_DECODE_ERROR);
  266. return 0;
  267. }
  268. /* set the private key */
  269. /* do not include the parameters in the SEC1 private key
  270. * see PKCS#11 12.11 */
  271. old_flags = EC_KEY_get_enc_flags(ec_key);
  272. tmp_flags = old_flags | EC_PKEY_NO_PARAMETERS;
  273. EC_KEY_set_enc_flags(ec_key, tmp_flags);
  274. eplen = i2d_ECPrivateKey(ec_key, NULL);
  275. if (!eplen) {
  276. EC_KEY_set_enc_flags(ec_key, old_flags);
  277. OPENSSL_PUT_ERROR(EVP, eckey_priv_encode, ERR_R_EC_LIB);
  278. return 0;
  279. }
  280. ep = (uint8_t *)OPENSSL_malloc(eplen);
  281. if (!ep) {
  282. EC_KEY_set_enc_flags(ec_key, old_flags);
  283. OPENSSL_PUT_ERROR(EVP, eckey_priv_encode, ERR_R_MALLOC_FAILURE);
  284. return 0;
  285. }
  286. p = ep;
  287. if (!i2d_ECPrivateKey(ec_key, &p)) {
  288. EC_KEY_set_enc_flags(ec_key, old_flags);
  289. OPENSSL_free(ep);
  290. OPENSSL_PUT_ERROR(EVP, eckey_priv_encode, ERR_R_EC_LIB);
  291. return 0;
  292. }
  293. /* restore old encoding flags */
  294. EC_KEY_set_enc_flags(ec_key, old_flags);
  295. if (!PKCS8_pkey_set0(p8, (ASN1_OBJECT *)OBJ_nid2obj(NID_X9_62_id_ecPublicKey),
  296. 0, ptype, pval, ep, eplen)) {
  297. return 0;
  298. }
  299. return 1;
  300. }
  301. static int int_ec_size(const EVP_PKEY *pkey) {
  302. return ECDSA_size(pkey->pkey.ec);
  303. }
  304. static int ec_bits(const EVP_PKEY *pkey) {
  305. BIGNUM *order = BN_new();
  306. const EC_GROUP *group;
  307. int ret;
  308. if (!order) {
  309. ERR_clear_error();
  310. return 0;
  311. }
  312. group = EC_KEY_get0_group(pkey->pkey.ec);
  313. if (!EC_GROUP_get_order(group, order, NULL)) {
  314. ERR_clear_error();
  315. return 0;
  316. }
  317. ret = BN_num_bits(order);
  318. BN_free(order);
  319. return ret;
  320. }
  321. static int ec_missing_parameters(const EVP_PKEY *pkey) {
  322. return EC_KEY_get0_group(pkey->pkey.ec) == NULL;
  323. }
  324. static int ec_copy_parameters(EVP_PKEY *to, const EVP_PKEY *from) {
  325. EC_GROUP *group = EC_GROUP_dup(EC_KEY_get0_group(from->pkey.ec));
  326. if (group == NULL ||
  327. EC_KEY_set_group(to->pkey.ec, group) == 0) {
  328. return 0;
  329. }
  330. EC_GROUP_free(group);
  331. return 1;
  332. }
  333. static int ec_cmp_parameters(const EVP_PKEY *a, const EVP_PKEY *b) {
  334. const EC_GROUP *group_a = EC_KEY_get0_group(a->pkey.ec),
  335. *group_b = EC_KEY_get0_group(b->pkey.ec);
  336. return EC_GROUP_cmp(group_a, group_b);
  337. }
  338. static void int_ec_free(EVP_PKEY *pkey) { EC_KEY_free(pkey->pkey.ec); }
  339. static int do_EC_KEY_print(BIO *bp, const EC_KEY *x, int off, int ktype) {
  340. uint8_t *buffer = NULL;
  341. const char *ecstr;
  342. size_t buf_len = 0, i;
  343. int ret = 0, reason = ERR_R_BIO_LIB;
  344. BIGNUM *order = NULL;
  345. BN_CTX *ctx = NULL;
  346. const EC_GROUP *group;
  347. const EC_POINT *public_key;
  348. const BIGNUM *priv_key;
  349. uint8_t *pub_key_bytes = NULL;
  350. size_t pub_key_bytes_len = 0;
  351. if (x == NULL || (group = EC_KEY_get0_group(x)) == NULL) {
  352. reason = ERR_R_PASSED_NULL_PARAMETER;
  353. goto err;
  354. }
  355. ctx = BN_CTX_new();
  356. if (ctx == NULL) {
  357. reason = ERR_R_MALLOC_FAILURE;
  358. goto err;
  359. }
  360. if (ktype > 0) {
  361. public_key = EC_KEY_get0_public_key(x);
  362. if (public_key != NULL) {
  363. pub_key_bytes_len = EC_POINT_point2oct(
  364. group, public_key, EC_KEY_get_conv_form(x), NULL, 0, ctx);
  365. if (pub_key_bytes_len == 0) {
  366. reason = ERR_R_MALLOC_FAILURE;
  367. goto err;
  368. }
  369. pub_key_bytes = OPENSSL_malloc(pub_key_bytes_len);
  370. if (pub_key_bytes == NULL) {
  371. reason = ERR_R_MALLOC_FAILURE;
  372. goto err;
  373. }
  374. pub_key_bytes_len =
  375. EC_POINT_point2oct(group, public_key, EC_KEY_get_conv_form(x),
  376. pub_key_bytes, pub_key_bytes_len, ctx);
  377. if (pub_key_bytes_len == 0) {
  378. reason = ERR_R_MALLOC_FAILURE;
  379. goto err;
  380. }
  381. buf_len = pub_key_bytes_len;
  382. }
  383. }
  384. if (ktype == 2) {
  385. priv_key = EC_KEY_get0_private_key(x);
  386. if (priv_key && (i = (size_t)BN_num_bytes(priv_key)) > buf_len)
  387. buf_len = i;
  388. } else
  389. priv_key = NULL;
  390. if (ktype > 0) {
  391. buf_len += 10;
  392. if ((buffer = OPENSSL_malloc(buf_len)) == NULL) {
  393. reason = ERR_R_MALLOC_FAILURE;
  394. goto err;
  395. }
  396. }
  397. if (ktype == 2)
  398. ecstr = "Private-Key";
  399. else if (ktype == 1)
  400. ecstr = "Public-Key";
  401. else
  402. ecstr = "ECDSA-Parameters";
  403. if (!BIO_indent(bp, off, 128))
  404. goto err;
  405. if ((order = BN_new()) == NULL)
  406. goto err;
  407. if (!EC_GROUP_get_order(group, order, NULL))
  408. goto err;
  409. if (BIO_printf(bp, "%s: (%d bit)\n", ecstr, BN_num_bits(order)) <= 0)
  410. goto err;
  411. if ((priv_key != NULL) && !ASN1_bn_print(bp, "priv:", priv_key, buffer, off))
  412. goto err;
  413. if (pub_key_bytes != NULL) {
  414. BIO_hexdump(bp, pub_key_bytes, pub_key_bytes_len, off);
  415. }
  416. /* TODO(fork): implement */
  417. /*
  418. if (!ECPKParameters_print(bp, group, off))
  419. goto err; */
  420. ret = 1;
  421. err:
  422. if (!ret)
  423. OPENSSL_PUT_ERROR(EVP, do_EC_KEY_print, reason);
  424. if (pub_key_bytes)
  425. OPENSSL_free(pub_key_bytes);
  426. if (order)
  427. BN_free(order);
  428. if (ctx)
  429. BN_CTX_free(ctx);
  430. if (buffer != NULL)
  431. OPENSSL_free(buffer);
  432. return ret;
  433. }
  434. static int eckey_param_decode(EVP_PKEY *pkey, const uint8_t **pder,
  435. int derlen) {
  436. EC_KEY *eckey;
  437. if (!(eckey = d2i_ECParameters(NULL, pder, derlen))) {
  438. OPENSSL_PUT_ERROR(EVP, eckey_param_decode, ERR_R_EC_LIB);
  439. return 0;
  440. }
  441. EVP_PKEY_assign_EC_KEY(pkey, eckey);
  442. return 1;
  443. }
  444. static int eckey_param_encode(const EVP_PKEY *pkey, uint8_t **pder) {
  445. return i2d_ECParameters(pkey->pkey.ec, pder);
  446. }
  447. static int eckey_param_print(BIO *bp, const EVP_PKEY *pkey, int indent,
  448. ASN1_PCTX *ctx) {
  449. return do_EC_KEY_print(bp, pkey->pkey.ec, indent, 0);
  450. }
  451. static int eckey_pub_print(BIO *bp, const EVP_PKEY *pkey, int indent,
  452. ASN1_PCTX *ctx) {
  453. return do_EC_KEY_print(bp, pkey->pkey.ec, indent, 1);
  454. }
  455. static int eckey_priv_print(BIO *bp, const EVP_PKEY *pkey, int indent,
  456. ASN1_PCTX *ctx) {
  457. return do_EC_KEY_print(bp, pkey->pkey.ec, indent, 2);
  458. }
  459. static int old_ec_priv_decode(EVP_PKEY *pkey, const uint8_t **pder,
  460. int derlen) {
  461. EC_KEY *ec;
  462. if (!(ec = d2i_ECPrivateKey(NULL, pder, derlen))) {
  463. OPENSSL_PUT_ERROR(EVP, old_ec_priv_decode, EVP_R_DECODE_ERROR);
  464. return 0;
  465. }
  466. EVP_PKEY_assign_EC_KEY(pkey, ec);
  467. return 1;
  468. }
  469. static int old_ec_priv_encode(const EVP_PKEY *pkey, uint8_t **pder) {
  470. return i2d_ECPrivateKey(pkey->pkey.ec, pder);
  471. }
  472. static int ec_pkey_ctrl(EVP_PKEY *pkey, int op, long arg1, void *arg2) {
  473. switch (op) {
  474. case ASN1_PKEY_CTRL_DEFAULT_MD_NID:
  475. *(int *)arg2 = NID_sha1;
  476. return 2;
  477. default:
  478. return -2;
  479. }
  480. }
  481. const EVP_PKEY_ASN1_METHOD ec_asn1_meth = {
  482. EVP_PKEY_EC,
  483. EVP_PKEY_EC,
  484. 0,
  485. "EC",
  486. "OpenSSL EC algorithm",
  487. eckey_pub_decode,
  488. eckey_pub_encode,
  489. eckey_pub_cmp,
  490. eckey_pub_print,
  491. eckey_priv_decode,
  492. eckey_priv_encode,
  493. eckey_priv_print,
  494. int_ec_size,
  495. ec_bits,
  496. eckey_param_decode,
  497. eckey_param_encode,
  498. ec_missing_parameters,
  499. ec_copy_parameters,
  500. ec_cmp_parameters,
  501. eckey_param_print,
  502. 0,
  503. int_ec_free,
  504. ec_pkey_ctrl,
  505. old_ec_priv_decode,
  506. old_ec_priv_encode
  507. };