diff options
| author | tb <> | 2024-04-17 23:24:18 +0000 |
|---|---|---|
| committer | tb <> | 2024-04-17 23:24:18 +0000 |
| commit | 6951f7a06932b31d0608ccc240cf63a714244adb (patch) | |
| tree | a5fcc7588b6c55ae13646033de77dd6a6591945c /src | |
| parent | 45a46f35ac16bea9f1a356339d50d88aa53e0ecb (diff) | |
| download | openbsd-6951f7a06932b31d0608ccc240cf63a714244adb.tar.gz openbsd-6951f7a06932b31d0608ccc240cf63a714244adb.tar.bz2 openbsd-6951f7a06932b31d0608ccc240cf63a714244adb.zip | |
Remove comments from captain obvious and drop useless prototypes
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libcrypto/ec/ec_asn1.c | 44 |
1 files changed, 1 insertions, 43 deletions
diff --git a/src/lib/libcrypto/ec/ec_asn1.c b/src/lib/libcrypto/ec/ec_asn1.c index 3bb550d569..2ce7d785c4 100644 --- a/src/lib/libcrypto/ec/ec_asn1.c +++ b/src/lib/libcrypto/ec/ec_asn1.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: ec_asn1.c,v 1.52 2024/04/15 15:46:29 tb Exp $ */ | 1 | /* $OpenBSD: ec_asn1.c,v 1.53 2024/04/17 23:24:18 tb Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Written by Nils Larsch for the OpenSSL project. | 3 | * Written by Nils Larsch for the OpenSSL project. |
| 4 | */ | 4 | */ |
| @@ -74,7 +74,6 @@ EC_GROUP_get_basis_type(const EC_GROUP *group) | |||
| 74 | } | 74 | } |
| 75 | LCRYPTO_ALIAS(EC_GROUP_get_basis_type); | 75 | LCRYPTO_ALIAS(EC_GROUP_get_basis_type); |
| 76 | 76 | ||
| 77 | /* some structures needed for the asn1 encoding */ | ||
| 78 | typedef struct x9_62_pentanomial_st { | 77 | typedef struct x9_62_pentanomial_st { |
| 79 | long k1; | 78 | long k1; |
| 80 | long k2; | 79 | long k2; |
| @@ -134,7 +133,6 @@ typedef struct ecpk_parameters_st { | |||
| 134 | } value; | 133 | } value; |
| 135 | } ECPKPARAMETERS; | 134 | } ECPKPARAMETERS; |
| 136 | 135 | ||
| 137 | /* SEC1 ECPrivateKey */ | ||
| 138 | typedef struct ec_privatekey_st { | 136 | typedef struct ec_privatekey_st { |
| 139 | long version; | 137 | long version; |
| 140 | ASN1_OCTET_STRING *privateKey; | 138 | ASN1_OCTET_STRING *privateKey; |
| @@ -142,7 +140,6 @@ typedef struct ec_privatekey_st { | |||
| 142 | ASN1_BIT_STRING *publicKey; | 140 | ASN1_BIT_STRING *publicKey; |
| 143 | } EC_PRIVATEKEY; | 141 | } EC_PRIVATEKEY; |
| 144 | 142 | ||
| 145 | /* the OpenSSL ASN.1 definitions */ | ||
| 146 | static const ASN1_TEMPLATE X9_62_PENTANOMIAL_seq_tt[] = { | 143 | static const ASN1_TEMPLATE X9_62_PENTANOMIAL_seq_tt[] = { |
| 147 | { | 144 | { |
| 148 | .flags = 0, | 145 | .flags = 0, |
| @@ -418,9 +415,6 @@ const ASN1_ITEM ECPARAMETERS_it = { | |||
| 418 | .sname = "ECPARAMETERS", | 415 | .sname = "ECPARAMETERS", |
| 419 | }; | 416 | }; |
| 420 | 417 | ||
| 421 | static ECPARAMETERS *ECPARAMETERS_new(void); | ||
| 422 | static void ECPARAMETERS_free(ECPARAMETERS *a); | ||
| 423 | |||
| 424 | static ECPARAMETERS * | 418 | static ECPARAMETERS * |
| 425 | ECPARAMETERS_new(void) | 419 | ECPARAMETERS_new(void) |
| 426 | { | 420 | { |
| @@ -467,11 +461,6 @@ const ASN1_ITEM ECPKPARAMETERS_it = { | |||
| 467 | .sname = "ECPKPARAMETERS", | 461 | .sname = "ECPKPARAMETERS", |
| 468 | }; | 462 | }; |
| 469 | 463 | ||
| 470 | static ECPKPARAMETERS *ECPKPARAMETERS_new(void); | ||
| 471 | static void ECPKPARAMETERS_free(ECPKPARAMETERS *a); | ||
| 472 | static ECPKPARAMETERS *d2i_ECPKPARAMETERS(ECPKPARAMETERS **a, const unsigned char **in, long len); | ||
| 473 | static int i2d_ECPKPARAMETERS(const ECPKPARAMETERS *a, unsigned char **out); | ||
| 474 | |||
| 475 | static ECPKPARAMETERS * | 464 | static ECPKPARAMETERS * |
| 476 | d2i_ECPKPARAMETERS(ECPKPARAMETERS **a, const unsigned char **in, long len) | 465 | d2i_ECPKPARAMETERS(ECPKPARAMETERS **a, const unsigned char **in, long len) |
| 477 | { | 466 | { |
| @@ -538,11 +527,6 @@ static const ASN1_ITEM EC_PRIVATEKEY_it = { | |||
| 538 | .sname = "EC_PRIVATEKEY", | 527 | .sname = "EC_PRIVATEKEY", |
| 539 | }; | 528 | }; |
| 540 | 529 | ||
| 541 | static EC_PRIVATEKEY *EC_PRIVATEKEY_new(void); | ||
| 542 | static void EC_PRIVATEKEY_free(EC_PRIVATEKEY *a); | ||
| 543 | static EC_PRIVATEKEY *d2i_EC_PRIVATEKEY(EC_PRIVATEKEY **a, const unsigned char **in, long len); | ||
| 544 | static int i2d_EC_PRIVATEKEY(const EC_PRIVATEKEY *a, unsigned char **out); | ||
| 545 | |||
| 546 | static EC_PRIVATEKEY * | 530 | static EC_PRIVATEKEY * |
| 547 | d2i_EC_PRIVATEKEY(EC_PRIVATEKEY **a, const unsigned char **in, long len) | 531 | d2i_EC_PRIVATEKEY(EC_PRIVATEKEY **a, const unsigned char **in, long len) |
| 548 | { | 532 | { |
| @@ -568,28 +552,6 @@ EC_PRIVATEKEY_free(EC_PRIVATEKEY *a) | |||
| 568 | ASN1_item_free((ASN1_VALUE *)a, &EC_PRIVATEKEY_it); | 552 | ASN1_item_free((ASN1_VALUE *)a, &EC_PRIVATEKEY_it); |
| 569 | } | 553 | } |
| 570 | 554 | ||
| 571 | /* some declarations of internal function */ | ||
| 572 | |||
| 573 | /* ec_asn1_group2fieldid() sets the values in a X9_62_FIELDID object */ | ||
| 574 | static int ec_asn1_group2fieldid(const EC_GROUP *, X9_62_FIELDID *); | ||
| 575 | /* ec_asn1_group2curve() sets the values in a X9_62_CURVE object */ | ||
| 576 | static int ec_asn1_group2curve(const EC_GROUP *, X9_62_CURVE *); | ||
| 577 | /* ec_asn1_parameters2group() creates a EC_GROUP object from a | ||
| 578 | * ECPARAMETERS object */ | ||
| 579 | static EC_GROUP *ec_asn1_parameters2group(const ECPARAMETERS *); | ||
| 580 | /* ec_asn1_group2parameters() creates a ECPARAMETERS object from a | ||
| 581 | * EC_GROUP object */ | ||
| 582 | static ECPARAMETERS *ec_asn1_group2parameters(const EC_GROUP *, ECPARAMETERS *); | ||
| 583 | /* ec_asn1_pkparameters2group() creates a EC_GROUP object from a | ||
| 584 | * ECPKPARAMETERS object */ | ||
| 585 | static EC_GROUP *ec_asn1_pkparameters2group(const ECPKPARAMETERS *); | ||
| 586 | /* ec_asn1_group2pkparameters() creates a ECPKPARAMETERS object from a | ||
| 587 | * EC_GROUP object */ | ||
| 588 | static ECPKPARAMETERS *ec_asn1_group2pkparameters(const EC_GROUP *, | ||
| 589 | ECPKPARAMETERS *); | ||
| 590 | |||
| 591 | /* the function definitions */ | ||
| 592 | |||
| 593 | static int | 555 | static int |
| 594 | ec_asn1_group2fieldid(const EC_GROUP *group, X9_62_FIELDID *field) | 556 | ec_asn1_group2fieldid(const EC_GROUP *group, X9_62_FIELDID *field) |
| 595 | { | 557 | { |
| @@ -1046,8 +1008,6 @@ ec_asn1_pkparameters2group(const ECPKPARAMETERS *params) | |||
| 1046 | return ret; | 1008 | return ret; |
| 1047 | } | 1009 | } |
| 1048 | 1010 | ||
| 1049 | /* EC_GROUP <-> DER encoding of ECPKPARAMETERS */ | ||
| 1050 | |||
| 1051 | EC_GROUP * | 1011 | EC_GROUP * |
| 1052 | d2i_ECPKParameters(EC_GROUP **a, const unsigned char **in, long len) | 1012 | d2i_ECPKParameters(EC_GROUP **a, const unsigned char **in, long len) |
| 1053 | { | 1013 | { |
| @@ -1093,8 +1053,6 @@ i2d_ECPKParameters(const EC_GROUP *a, unsigned char **out) | |||
| 1093 | } | 1053 | } |
| 1094 | LCRYPTO_ALIAS(i2d_ECPKParameters); | 1054 | LCRYPTO_ALIAS(i2d_ECPKParameters); |
| 1095 | 1055 | ||
| 1096 | /* some EC_KEY functions */ | ||
| 1097 | |||
| 1098 | EC_KEY * | 1056 | EC_KEY * |
| 1099 | d2i_ECPrivateKey(EC_KEY **a, const unsigned char **in, long len) | 1057 | d2i_ECPrivateKey(EC_KEY **a, const unsigned char **in, long len) |
| 1100 | { | 1058 | { |
