ec_asn1.c
Go to the documentation of this file.
1 /* Written by Nils Larsch for the OpenSSL project. */
2 /* ====================================================================
3  * Copyright (c) 2000-2003 The OpenSSL Project. All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * 1. Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * 2. Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in
14  * the documentation and/or other materials provided with the
15  * distribution.
16  *
17  * 3. All advertising materials mentioning features or use of this
18  * software must display the following acknowledgment:
19  * "This product includes software developed by the OpenSSL Project
20  * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
21  *
22  * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
23  * endorse or promote products derived from this software without
24  * prior written permission. For written permission, please contact
25  * licensing@OpenSSL.org.
26  *
27  * 5. Products derived from this software may not be called "OpenSSL"
28  * nor may "OpenSSL" appear in their names without prior written
29  * permission of the OpenSSL Project.
30  *
31  * 6. Redistributions of any form whatsoever must retain the following
32  * acknowledgment:
33  * "This product includes software developed by the OpenSSL Project
34  * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
35  *
36  * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
37  * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
38  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
39  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
40  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
41  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
42  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
43  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
44  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
45  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
46  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
47  * OF THE POSSIBILITY OF SUCH DAMAGE.
48  * ====================================================================
49  *
50  * This product includes cryptographic software written by Eric Young
51  * (eay@cryptsoft.com). This product includes software written by Tim
52  * Hudson (tjh@cryptsoft.com). */
53 
54 #include <openssl/ec.h>
55 
56 #include <limits.h>
57 #include <string.h>
58 
59 #include <openssl/bytestring.h>
60 #include <openssl/bn.h>
61 #include <openssl/err.h>
62 #include <openssl/mem.h>
63 #include <openssl/nid.h>
64 
65 #include "../fipsmodule/ec/internal.h"
66 #include "../bytestring/internal.h"
67 #include "../internal.h"
68 
69 
70 static const unsigned kParametersTag =
72 static const unsigned kPublicKeyTag =
74 
76  CBS ec_private_key, private_key;
78  if (!CBS_get_asn1(cbs, &ec_private_key, CBS_ASN1_SEQUENCE) ||
79  !CBS_get_asn1_uint64(&ec_private_key, &version) ||
80  version != 1 ||
81  !CBS_get_asn1(&ec_private_key, &private_key, CBS_ASN1_OCTETSTRING)) {
83  return NULL;
84  }
85 
86  // Parse the optional parameters field.
87  EC_GROUP *inner_group = NULL;
88  EC_KEY *ret = NULL;
89  BIGNUM *priv_key = NULL;
90  if (CBS_peek_asn1_tag(&ec_private_key, kParametersTag)) {
91  // Per SEC 1, as an alternative to omitting it, one is allowed to specify
92  // this field and put in a NULL to mean inheriting this value. This was
93  // omitted in a previous version of this logic without problems, so leave it
94  // unimplemented.
95  CBS child;
96  if (!CBS_get_asn1(&ec_private_key, &child, kParametersTag)) {
98  goto err;
99  }
100  inner_group = EC_KEY_parse_parameters(&child);
101  if (inner_group == NULL) {
102  goto err;
103  }
104  if (group == NULL) {
105  group = inner_group;
106  } else if (EC_GROUP_cmp(group, inner_group, NULL) != 0) {
107  // If a group was supplied externally, it must match.
109  goto err;
110  }
111  if (CBS_len(&child) != 0) {
113  goto err;
114  }
115  }
116 
117  if (group == NULL) {
119  goto err;
120  }
121 
122  ret = EC_KEY_new();
123  if (ret == NULL || !EC_KEY_set_group(ret, group)) {
124  goto err;
125  }
126 
127  // Although RFC 5915 specifies the length of the key, OpenSSL historically
128  // got this wrong, so accept any length. See upstream's
129  // 30cd4ff294252c4b6a4b69cbef6a5b4117705d22.
130  priv_key = BN_bin2bn(CBS_data(&private_key), CBS_len(&private_key), NULL);
131  ret->pub_key = EC_POINT_new(group);
132  if (priv_key == NULL || ret->pub_key == NULL ||
133  !EC_KEY_set_private_key(ret, priv_key)) {
134  goto err;
135  }
136 
137  if (CBS_peek_asn1_tag(&ec_private_key, kPublicKeyTag)) {
139  uint8_t padding;
140  if (!CBS_get_asn1(&ec_private_key, &child, kPublicKeyTag) ||
142  // As in a SubjectPublicKeyInfo, the byte-encoded public key is then
143  // encoded as a BIT STRING with bits ordered as in the DER encoding.
144  !CBS_get_u8(&public_key, &padding) ||
145  padding != 0 ||
146  // Explicitly check |public_key| is non-empty to save the conversion
147  // form later.
148  CBS_len(&public_key) == 0 ||
150  CBS_len(&public_key), NULL) ||
151  CBS_len(&child) != 0) {
153  goto err;
154  }
155 
156  // Save the point conversion form.
157  // TODO(davidben): Consider removing this.
158  ret->conv_form =
160  } else {
161  // Compute the public key instead.
162  if (!ec_point_mul_scalar_base(group, &ret->pub_key->raw,
163  &ret->priv_key->scalar)) {
164  goto err;
165  }
166  // Remember the original private-key-only encoding.
167  // TODO(davidben): Consider removing this.
168  ret->enc_flag |= EC_PKEY_NO_PUBKEY;
169  }
170 
171  if (CBS_len(&ec_private_key) != 0) {
173  goto err;
174  }
175 
176  // Ensure the resulting key is valid.
177  if (!EC_KEY_check_key(ret)) {
178  goto err;
179  }
180 
181  BN_free(priv_key);
182  EC_GROUP_free(inner_group);
183  return ret;
184 
185 err:
186  EC_KEY_free(ret);
187  BN_free(priv_key);
188  EC_GROUP_free(inner_group);
189  return NULL;
190 }
191 
193  unsigned enc_flags) {
194  if (key == NULL || key->group == NULL || key->priv_key == NULL) {
196  return 0;
197  }
198 
199  CBB ec_private_key, private_key;
200  if (!CBB_add_asn1(cbb, &ec_private_key, CBS_ASN1_SEQUENCE) ||
201  !CBB_add_asn1_uint64(&ec_private_key, 1 /* version */) ||
202  !CBB_add_asn1(&ec_private_key, &private_key, CBS_ASN1_OCTETSTRING) ||
207  return 0;
208  }
209 
210  if (!(enc_flags & EC_PKEY_NO_PARAMETERS)) {
211  CBB child;
212  if (!CBB_add_asn1(&ec_private_key, &child, kParametersTag) ||
213  !EC_KEY_marshal_curve_name(&child, key->group) ||
214  !CBB_flush(&ec_private_key)) {
216  return 0;
217  }
218  }
219 
220  // TODO(fork): replace this flexibility with sensible default?
221  if (!(enc_flags & EC_PKEY_NO_PUBKEY) && key->pub_key != NULL) {
223  if (!CBB_add_asn1(&ec_private_key, &child, kPublicKeyTag) ||
225  // As in a SubjectPublicKeyInfo, the byte-encoded public key is then
226  // encoded as a BIT STRING with bits ordered as in the DER encoding.
227  !CBB_add_u8(&public_key, 0 /* padding */) ||
228  !EC_POINT_point2cbb(&public_key, key->group, key->pub_key,
229  key->conv_form, NULL) ||
230  !CBB_flush(&ec_private_key)) {
232  return 0;
233  }
234  }
235 
236  if (!CBB_flush(cbb)) {
238  return 0;
239  }
240 
241  return 1;
242 }
243 
244 // kPrimeFieldOID is the encoding of 1.2.840.10045.1.1.
245 static const uint8_t kPrimeField[] = {0x2a, 0x86, 0x48, 0xce, 0x3d, 0x01, 0x01};
246 
247 static int parse_explicit_prime_curve(CBS *in, CBS *out_prime, CBS *out_a,
248  CBS *out_b, CBS *out_base_x,
249  CBS *out_base_y, CBS *out_order) {
250  // See RFC 3279, section 2.3.5. Note that RFC 3279 calls this structure an
251  // ECParameters while RFC 5480 calls it a SpecifiedECDomain.
252  CBS params, field_id, field_type, curve, base, cofactor;
253  int has_cofactor;
255  if (!CBS_get_asn1(in, &params, CBS_ASN1_SEQUENCE) ||
256  !CBS_get_asn1_uint64(&params, &version) ||
257  version != 1 ||
258  !CBS_get_asn1(&params, &field_id, CBS_ASN1_SEQUENCE) ||
259  !CBS_get_asn1(&field_id, &field_type, CBS_ASN1_OBJECT) ||
260  CBS_len(&field_type) != sizeof(kPrimeField) ||
262  0 ||
263  !CBS_get_asn1(&field_id, out_prime, CBS_ASN1_INTEGER) ||
264  !CBS_is_unsigned_asn1_integer(out_prime) ||
265  CBS_len(&field_id) != 0 ||
266  !CBS_get_asn1(&params, &curve, CBS_ASN1_SEQUENCE) ||
267  !CBS_get_asn1(&curve, out_a, CBS_ASN1_OCTETSTRING) ||
268  !CBS_get_asn1(&curve, out_b, CBS_ASN1_OCTETSTRING) ||
269  // |curve| has an optional BIT STRING seed which we ignore.
270  !CBS_get_optional_asn1(&curve, NULL, NULL, CBS_ASN1_BITSTRING) ||
271  CBS_len(&curve) != 0 ||
272  !CBS_get_asn1(&params, &base, CBS_ASN1_OCTETSTRING) ||
273  !CBS_get_asn1(&params, out_order, CBS_ASN1_INTEGER) ||
274  !CBS_is_unsigned_asn1_integer(out_order) ||
275  !CBS_get_optional_asn1(&params, &cofactor, &has_cofactor,
276  CBS_ASN1_INTEGER) ||
277  CBS_len(&params) != 0) {
279  return 0;
280  }
281 
282  if (has_cofactor) {
283  // We only support prime-order curves so the cofactor must be one.
284  if (CBS_len(&cofactor) != 1 ||
285  CBS_data(&cofactor)[0] != 1) {
287  return 0;
288  }
289  }
290 
291  // Require that the base point use uncompressed form.
292  uint8_t form;
293  if (!CBS_get_u8(&base, &form) || form != POINT_CONVERSION_UNCOMPRESSED) {
295  return 0;
296  }
297 
298  if (CBS_len(&base) % 2 != 0) {
300  return 0;
301  }
302  size_t field_len = CBS_len(&base) / 2;
303  CBS_init(out_base_x, CBS_data(&base), field_len);
304  CBS_init(out_base_y, CBS_data(&base) + field_len, field_len);
305 
306  return 1;
307 }
308 
309 // integers_equal returns one if |a| and |b| are equal, up to leading zeros, and
310 // zero otherwise.
311 static int integers_equal(const CBS *a, const uint8_t *b, size_t b_len) {
312  // Remove leading zeros from |a| and |b|.
313  CBS a_copy = *a;
314  while (CBS_len(&a_copy) > 0 && CBS_data(&a_copy)[0] == 0) {
315  CBS_skip(&a_copy, 1);
316  }
317  while (b_len > 0 && b[0] == 0) {
318  b++;
319  b_len--;
320  }
321  return CBS_mem_equal(&a_copy, b, b_len);
322 }
323 
325  CBS named_curve;
326  if (!CBS_get_asn1(cbs, &named_curve, CBS_ASN1_OBJECT)) {
328  return NULL;
329  }
330 
331  // Look for a matching curve.
332  const struct built_in_curves *const curves = OPENSSL_built_in_curves();
333  for (size_t i = 0; i < OPENSSL_NUM_BUILT_IN_CURVES; i++) {
334  const struct built_in_curve *curve = &curves->curves[i];
335  if (CBS_len(&named_curve) == curve->oid_len &&
336  OPENSSL_memcmp(CBS_data(&named_curve), curve->oid, curve->oid_len) ==
337  0) {
338  return EC_GROUP_new_by_curve_name(curve->nid);
339  }
340  }
341 
343  return NULL;
344 }
345 
348  if (nid == NID_undef) {
350  return 0;
351  }
352 
353  const struct built_in_curves *const curves = OPENSSL_built_in_curves();
354  for (size_t i = 0; i < OPENSSL_NUM_BUILT_IN_CURVES; i++) {
355  const struct built_in_curve *curve = &curves->curves[i];
356  if (curve->nid == nid) {
357  CBB child;
358  return CBB_add_asn1(cbb, &child, CBS_ASN1_OBJECT) &&
359  CBB_add_bytes(&child, curve->oid, curve->oid_len) &&
360  CBB_flush(cbb);
361  }
362  }
363 
365  return 0;
366 }
367 
371  }
372 
373  // OpenSSL sometimes produces ECPrivateKeys with explicitly-encoded versions
374  // of named curves.
375  //
376  // TODO(davidben): Remove support for this.
377  CBS prime, a, b, base_x, base_y, order;
378  if (!parse_explicit_prime_curve(cbs, &prime, &a, &b, &base_x, &base_y,
379  &order)) {
380  return NULL;
381  }
382 
383  // Look for a matching prime curve.
384  const struct built_in_curves *const curves = OPENSSL_built_in_curves();
385  for (size_t i = 0; i < OPENSSL_NUM_BUILT_IN_CURVES; i++) {
386  const struct built_in_curve *curve = &curves->curves[i];
387  const unsigned param_len = curve->param_len;
388  // |curve->params| is ordered p, a, b, x, y, order, each component
389  // zero-padded up to the field length. Although SEC 1 states that the
390  // Field-Element-to-Octet-String conversion also pads, OpenSSL mis-encodes
391  // |a| and |b|, so this comparison must allow omitting leading zeros. (This
392  // is relevant for P-521 whose |b| has a leading 0.)
393  if (integers_equal(&prime, curve->params, param_len) &&
394  integers_equal(&a, curve->params + param_len, param_len) &&
395  integers_equal(&b, curve->params + param_len * 2, param_len) &&
396  integers_equal(&base_x, curve->params + param_len * 3, param_len) &&
397  integers_equal(&base_y, curve->params + param_len * 4, param_len) &&
398  integers_equal(&order, curve->params + param_len * 5, param_len)) {
399  return EC_GROUP_new_by_curve_name(curve->nid);
400  }
401  }
402 
404  return NULL;
405 }
406 
409  size_t len = EC_POINT_point2oct(group, point, form, NULL, 0, ctx);
410  if (len == 0) {
411  return 0;
412  }
413  uint8_t *p;
414  return CBB_add_space(out, &p, len) &&
415  EC_POINT_point2oct(group, point, form, p, len, ctx) == len;
416 }
417 
419  // This function treats its |out| parameter differently from other |d2i|
420  // functions. If supplied, take the group from |*out|.
421  const EC_GROUP *group = NULL;
422  if (out != NULL && *out != NULL) {
424  }
425 
426  if (len < 0) {
428  return NULL;
429  }
430  CBS cbs;
431  CBS_init(&cbs, *inp, (size_t)len);
433  if (ret == NULL) {
434  return NULL;
435  }
436  if (out != NULL) {
437  EC_KEY_free(*out);
438  *out = ret;
439  }
440  *inp = CBS_data(&cbs);
441  return ret;
442 }
443 
444 int i2d_ECPrivateKey(const EC_KEY *key, uint8_t **outp) {
445  CBB cbb;
446  if (!CBB_init(&cbb, 0) ||
448  CBB_cleanup(&cbb);
449  return -1;
450  }
451  return CBB_finish_i2d(&cbb, outp);
452 }
453 
454 EC_KEY *d2i_ECParameters(EC_KEY **out_key, const uint8_t **inp, long len) {
455  if (len < 0) {
456  return NULL;
457  }
458 
459  CBS cbs;
460  CBS_init(&cbs, *inp, (size_t)len);
462  if (group == NULL) {
463  return NULL;
464  }
465 
466  EC_KEY *ret = EC_KEY_new();
467  if (ret == NULL || !EC_KEY_set_group(ret, group)) {
469  EC_KEY_free(ret);
470  return NULL;
471  }
473 
474  if (out_key != NULL) {
475  EC_KEY_free(*out_key);
476  *out_key = ret;
477  }
478  *inp = CBS_data(&cbs);
479  return ret;
480 }
481 
482 int i2d_ECParameters(const EC_KEY *key, uint8_t **outp) {
483  if (key == NULL || key->group == NULL) {
485  return -1;
486  }
487 
488  CBB cbb;
489  if (!CBB_init(&cbb, 0) ||
490  !EC_KEY_marshal_curve_name(&cbb, key->group)) {
491  CBB_cleanup(&cbb);
492  return -1;
493  }
494  return CBB_finish_i2d(&cbb, outp);
495 }
496 
497 EC_KEY *o2i_ECPublicKey(EC_KEY **keyp, const uint8_t **inp, long len) {
498  EC_KEY *ret = NULL;
499 
500  if (keyp == NULL || *keyp == NULL || (*keyp)->group == NULL) {
502  return NULL;
503  }
504  ret = *keyp;
505  if (ret->pub_key == NULL &&
506  (ret->pub_key = EC_POINT_new(ret->group)) == NULL) {
508  return NULL;
509  }
510  if (!EC_POINT_oct2point(ret->group, ret->pub_key, *inp, len, NULL)) {
512  return NULL;
513  }
514  // save the point conversion form
515  ret->conv_form = (point_conversion_form_t)(*inp[0] & ~0x01);
516  *inp += len;
517  return ret;
518 }
519 
520 int i2o_ECPublicKey(const EC_KEY *key, uint8_t **outp) {
521  size_t buf_len = 0;
522  int new_buffer = 0;
523 
524  if (key == NULL) {
526  return 0;
527  }
528 
529  buf_len = EC_POINT_point2oct(key->group, key->pub_key, key->conv_form, NULL,
530  0, NULL);
531 
532  if (outp == NULL || buf_len == 0) {
533  // out == NULL => just return the length of the octet string
534  return buf_len;
535  }
536 
537  if (*outp == NULL) {
538  *outp = OPENSSL_malloc(buf_len);
539  if (*outp == NULL) {
541  return 0;
542  }
543  new_buffer = 1;
544  }
545  if (!EC_POINT_point2oct(key->group, key->pub_key, key->conv_form, *outp,
546  buf_len, NULL)) {
548  if (new_buffer) {
549  OPENSSL_free(*outp);
550  *outp = NULL;
551  }
552  return 0;
553  }
554 
555  if (!new_buffer) {
556  *outp += buf_len;
557  }
558  return buf_len;
559 }
EC_GROUP_get0_order
#define EC_GROUP_get0_order
Definition: boringssl_prefix_symbols.h:1323
CBS_get_asn1_uint64
#define CBS_get_asn1_uint64
Definition: boringssl_prefix_symbols.h:1066
EC_KEY_get0_private_key
#define EC_KEY_get0_private_key
Definition: boringssl_prefix_symbols.h:1345
CBS_ASN1_INTEGER
#define CBS_ASN1_INTEGER
Definition: bytestring.h:207
bn.h
EC_POINT_new
#define EC_POINT_new
Definition: boringssl_prefix_symbols.h:1384
CBB_flush
#define CBB_flush
Definition: boringssl_prefix_symbols.h:1045
ec_point_mul_scalar_base
#define ec_point_mul_scalar_base
Definition: boringssl_prefix_symbols.h:3116
public_key
Definition: hrss.c:1881
CBB_init
#define CBB_init
Definition: boringssl_prefix_symbols.h:1047
gen_build_yaml.out
dictionary out
Definition: src/benchmark/gen_build_yaml.py:24
cbs_st
Definition: bytestring.h:39
OPENSSL_memcmp
static int OPENSSL_memcmp(const void *s1, const void *s2, size_t n)
Definition: third_party/boringssl-with-bazel/src/crypto/internal.h:811
EC_KEY_new
#define EC_KEY_new
Definition: boringssl_prefix_symbols.h:1355
ctx
Definition: benchmark-async.c:30
EC_POINT_point2oct
#define EC_POINT_point2oct
Definition: boringssl_prefix_symbols.h:1387
CBB_cleanup
#define CBB_cleanup
Definition: boringssl_prefix_symbols.h:1039
CBS_skip
#define CBS_skip
Definition: boringssl_prefix_symbols.h:1092
built_in_curve::oid_len
uint8_t oid_len
Definition: third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/internal.h:745
built_in_curves
Definition: third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/internal.h:759
CBS_data
#define CBS_data
Definition: boringssl_prefix_symbols.h:1057
regen-readme.inp
inp
Definition: regen-readme.py:11
OPENSSL_NUM_BUILT_IN_CURVES
#define OPENSSL_NUM_BUILT_IN_CURVES
Definition: third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/internal.h:757
EC_KEY_parse_curve_name
EC_GROUP * EC_KEY_parse_curve_name(CBS *cbs)
Definition: ec_asn1.c:324
EC_KEY_marshal_curve_name
int EC_KEY_marshal_curve_name(CBB *cbb, const EC_GROUP *group)
Definition: ec_asn1.c:346
BN_bin2bn
#define BN_bin2bn
Definition: boringssl_prefix_symbols.h:900
OPENSSL_PUT_ERROR
#define OPENSSL_PUT_ERROR(library, reason)
Definition: err.h:423
kPrimeField
static const uint8_t kPrimeField[]
Definition: ec_asn1.c:245
string.h
parse_explicit_prime_curve
static int parse_explicit_prime_curve(CBS *in, CBS *out_prime, CBS *out_a, CBS *out_b, CBS *out_base_x, CBS *out_base_y, CBS *out_order)
Definition: ec_asn1.c:247
CBS_ASN1_OCTETSTRING
#define CBS_ASN1_OCTETSTRING
Definition: bytestring.h:209
CBB_add_u8
#define CBB_add_u8
Definition: boringssl_prefix_symbols.h:1036
CBS_mem_equal
#define CBS_mem_equal
Definition: boringssl_prefix_symbols.h:1090
CBS_ASN1_CONTEXT_SPECIFIC
#define CBS_ASN1_CONTEXT_SPECIFIC
Definition: bytestring.h:194
EC_KEY_set_group
#define EC_KEY_set_group
Definition: boringssl_prefix_symbols.h:1365
error_ref_leak.err
err
Definition: error_ref_leak.py:35
EC_R_UNKNOWN_GROUP
#define EC_R_UNKNOWN_GROUP
Definition: ec.h:430
CBS_len
#define CBS_len
Definition: boringssl_prefix_symbols.h:1089
integers_equal
static int integers_equal(const CBS *a, const uint8_t *b, size_t b_len)
Definition: ec_asn1.c:311
EC_GROUP_new_by_curve_name
#define EC_GROUP_new_by_curve_name
Definition: boringssl_prefix_symbols.h:1331
CBB_add_space
#define CBB_add_space
Definition: boringssl_prefix_symbols.h:1026
CBS_get_asn1
#define CBS_get_asn1
Definition: boringssl_prefix_symbols.h:1061
version
Definition: version.py:1
BN_free
#define BN_free
Definition: boringssl_prefix_symbols.h:923
a
int a
Definition: abseil-cpp/absl/container/internal/hash_policy_traits_test.cc:88
bignum_ctx
Definition: ctx.c:91
cbs
const CBS * cbs
Definition: third_party/boringssl-with-bazel/src/crypto/trust_token/internal.h:107
xds_manager.p
p
Definition: xds_manager.py:60
BN_num_bytes
#define BN_num_bytes
Definition: boringssl_prefix_symbols.h:976
CBS_init
#define CBS_init
Definition: boringssl_prefix_symbols.h:1085
ERR_R_EC_LIB
#define ERR_R_EC_LIB
Definition: err.h:343
uint8_t
unsigned char uint8_t
Definition: stdint-msvc2008.h:78
EC_KEY_get0_group
#define EC_KEY_get0_group
Definition: boringssl_prefix_symbols.h:1344
kParametersTag
static const unsigned kParametersTag
Definition: ec_asn1.c:70
EC_KEY_get_enc_flags
#define EC_KEY_get_enc_flags
Definition: boringssl_prefix_symbols.h:1348
EC_R_GROUP_MISMATCH
#define EC_R_GROUP_MISMATCH
Definition: ec.h:437
i2d_ECPrivateKey
int i2d_ECPrivateKey(const EC_KEY *key, uint8_t **outp)
Definition: ec_asn1.c:444
OPENSSL_malloc
#define OPENSSL_malloc
Definition: boringssl_prefix_symbols.h:1885
EC_GROUP_free
#define EC_GROUP_free
Definition: boringssl_prefix_symbols.h:1321
bytestring.h
EC_POINT_point2cbb
int EC_POINT_point2cbb(CBB *out, const EC_GROUP *group, const EC_POINT *point, point_conversion_form_t form, BN_CTX *ctx)
Definition: ec_asn1.c:407
CBS_peek_asn1_tag
#define CBS_peek_asn1_tag
Definition: boringssl_prefix_symbols.h:1091
in
const char * in
Definition: third_party/abseil-cpp/absl/strings/internal/str_format/parser_test.cc:391
EC_R_MISSING_PARAMETERS
#define EC_R_MISSING_PARAMETERS
Definition: ec.h:421
built_in_curve
Definition: third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/internal.h:742
built_in_curves::curves
struct built_in_curve curves[OPENSSL_NUM_BUILT_IN_CURVES]
Definition: third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/internal.h:760
ERR_R_PASSED_NULL_PARAMETER
#define ERR_R_PASSED_NULL_PARAMETER
Definition: err.h:373
i2o_ECPublicKey
int i2o_ECPublicKey(const EC_KEY *key, uint8_t **outp)
Definition: ec_asn1.c:520
EC_GROUP_cmp
#define EC_GROUP_cmp
Definition: boringssl_prefix_symbols.h:1319
OPENSSL_built_in_curves
const struct built_in_curves * OPENSSL_built_in_curves(void)
EC_GROUP_get_curve_name
#define EC_GROUP_get_curve_name
Definition: boringssl_prefix_symbols.h:1327
BN_bn2cbb_padded
#define BN_bn2cbb_padded
Definition: boringssl_prefix_symbols.h:904
conf.version
string version
Definition: doc/python/sphinx/conf.py:36
uint64_t
unsigned __int64 uint64_t
Definition: stdint-msvc2008.h:90
CBB_add_asn1
#define CBB_add_asn1
Definition: boringssl_prefix_symbols.h:1019
EC_KEY_parse_private_key
EC_KEY * EC_KEY_parse_private_key(CBS *cbs, const EC_GROUP *group)
Definition: ec_asn1.c:75
CBS_get_u8
#define CBS_get_u8
Definition: boringssl_prefix_symbols.h:1082
err.h
EC_PKEY_NO_PUBKEY
#define EC_PKEY_NO_PUBKEY
Definition: ec_key.h:146
googletest-filter-unittest.child
child
Definition: bloaty/third_party/googletest/googletest/test/googletest-filter-unittest.py:62
NID_undef
#define NID_undef
Definition: nid.h:85
gen_synthetic_protos.base
base
Definition: gen_synthetic_protos.py:31
i2d_ECParameters
int i2d_ECParameters(const EC_KEY *key, uint8_t **outp)
Definition: ec_asn1.c:482
b
uint64_t b
Definition: abseil-cpp/absl/container/internal/layout_test.cc:53
EC_KEY_free
#define EC_KEY_free
Definition: boringssl_prefix_symbols.h:1341
CBS_ASN1_CONSTRUCTED
#define CBS_ASN1_CONSTRUCTED
Definition: bytestring.h:188
built_in_curve::param_len
uint8_t param_len
Definition: third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/internal.h:749
nid
int nid
Definition: cipher_extra.c:71
EC_PKEY_NO_PARAMETERS
#define EC_PKEY_NO_PARAMETERS
Definition: ec_key.h:145
built_in_curve::nid
int nid
Definition: third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/internal.h:743
ec_key_st
Definition: third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/internal.h:723
point
Definition: bloaty/third_party/zlib/examples/zran.c:67
EC_R_ENCODE_ERROR
#define EC_R_ENCODE_ERROR
Definition: ec.h:436
d2i_ECPrivateKey
EC_KEY * d2i_ECPrivateKey(EC_KEY **out, const uint8_t **inp, long len)
Definition: ec_asn1.c:418
d2i_ECParameters
EC_KEY * d2i_ECParameters(EC_KEY **out_key, const uint8_t **inp, long len)
Definition: ec_asn1.c:454
CBB_add_bytes
#define CBB_add_bytes
Definition: boringssl_prefix_symbols.h:1025
nid.h
key
const char * key
Definition: hpack_parser_table.cc:164
CBS_get_optional_asn1
#define CBS_get_optional_asn1
Definition: boringssl_prefix_symbols.h:1069
upload.group
group
Definition: bloaty/third_party/googletest/googlemock/scripts/upload.py:397
CBS_ASN1_BITSTRING
#define CBS_ASN1_BITSTRING
Definition: bytestring.h:208
CBS_is_unsigned_asn1_integer
#define CBS_is_unsigned_asn1_integer
Definition: boringssl_prefix_symbols.h:1086
EC_POINT_oct2point
#define EC_POINT_oct2point
Definition: boringssl_prefix_symbols.h:1385
point_conversion_form_t
point_conversion_form_t
Definition: ec.h:83
POINT_CONVERSION_UNCOMPRESSED
@ POINT_CONVERSION_UNCOMPRESSED
Definition: ec.h:91
bignum_st
Definition: bn.h:957
o2i_ECPublicKey
EC_KEY * o2i_ECPublicKey(EC_KEY **keyp, const uint8_t **inp, long len)
Definition: ec_asn1.c:497
CBS_ASN1_OBJECT
#define CBS_ASN1_OBJECT
Definition: bytestring.h:211
ec_point_st
Definition: third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/internal.h:615
ret
UniquePtr< SSL_SESSION > ret
Definition: ssl_x509.cc:1029
private_key
Definition: hrss.c:1885
ec_group_st
Definition: third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/internal.h:573
ec_key_st::group
EC_GROUP * group
Definition: third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/internal.h:724
field_type
zend_class_entry * field_type
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/message.c:2030
EC_KEY_check_key
#define EC_KEY_check_key
Definition: boringssl_prefix_symbols.h:1338
CBB_finish_i2d
#define CBB_finish_i2d
Definition: boringssl_prefix_symbols.h:1044
EC_KEY_marshal_private_key
int EC_KEY_marshal_private_key(CBB *cbb, const EC_KEY *key, unsigned enc_flags)
Definition: ec_asn1.c:192
EC_KEY_set_private_key
#define EC_KEY_set_private_key
Definition: boringssl_prefix_symbols.h:1366
EC_R_DECODE_ERROR
#define EC_R_DECODE_ERROR
Definition: ec.h:435
built_in_curve::params
const uint8_t * params
Definition: third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/internal.h:753
built_in_curve::oid
const uint8_t * oid
Definition: third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/internal.h:744
kPublicKeyTag
static const unsigned kPublicKeyTag
Definition: ec_asn1.c:72
mem.h
len
int len
Definition: abseil-cpp/absl/base/internal/low_level_alloc_test.cc:46
CBS_ASN1_SEQUENCE
#define CBS_ASN1_SEQUENCE
Definition: bytestring.h:214
tests.interop.resources.private_key
def private_key()
Definition: interop/resources.py:29
EC_KEY_parse_parameters
EC_GROUP * EC_KEY_parse_parameters(CBS *cbs)
Definition: ec_asn1.c:368
ec.h
OPENSSL_free
#define OPENSSL_free
Definition: boringssl_prefix_symbols.h:1869
EC_R_INVALID_FORM
#define EC_R_INVALID_FORM
Definition: ec.h:418
i
uint64_t i
Definition: abseil-cpp/absl/container/btree_benchmark.cc:230
ERR_R_MALLOC_FAILURE
#define ERR_R_MALLOC_FAILURE
Definition: err.h:371
CBB_add_asn1_uint64
#define CBB_add_asn1_uint64
Definition: boringssl_prefix_symbols.h:1024
cbb_st
Definition: bytestring.h:375


grpc
Author(s):
autogenerated on Fri May 16 2025 02:58:18