summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortb <>2025-05-04 05:10:14 +0000
committertb <>2025-05-04 05:10:14 +0000
commitab1eac0c4761085b0ec9fe7629dc4a34e0019179 (patch)
treecfe048c1fe8b5ce3e820d3a8803d616354fbf7d2 /src
parent60acc98f53cc958afe45b7f69e1f5245c2969b74 (diff)
downloadopenbsd-ab1eac0c4761085b0ec9fe7629dc4a34e0019179.tar.gz
openbsd-ab1eac0c4761085b0ec9fe7629dc4a34e0019179.tar.bz2
openbsd-ab1eac0c4761085b0ec9fe7629dc4a34e0019179.zip
Remove the X9.62 prime239v{1,2,3} curves
While RFC 3279 allows these curves for use in X.509 certificates (*), no one actually does this. Certs using these curves cannot be used for TLS and the curves aren't accepted by FIPS either. codesearch shows no actual uses of these curves, only their OIDs are listed. At this point these have become useless historical baggage. ok jsing (*) Of the 27 curves listed in RFC 3279 the only one that seems to have seen actual use in certificates is P-256.
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/ec/ec_curve.c180
1 files changed, 1 insertions, 179 deletions
diff --git a/src/lib/libcrypto/ec/ec_curve.c b/src/lib/libcrypto/ec/ec_curve.c
index ec7a4f5390..6212247ff2 100644
--- a/src/lib/libcrypto/ec/ec_curve.c
+++ b/src/lib/libcrypto/ec/ec_curve.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ec_curve.c,v 1.56 2025/05/04 04:57:48 tb Exp $ */ 1/* $OpenBSD: ec_curve.c,v 1.57 2025/05/04 05:10:14 tb Exp $ */
2/* 2/*
3 * Written by Nils Larsch for the OpenSSL project. 3 * Written by Nils Larsch for the OpenSSL project.
4 */ 4 */
@@ -306,141 +306,6 @@ static const struct {
306}; 306};
307 307
308static const struct { 308static const struct {
309 uint8_t seed[20];
310 uint8_t p[30];
311 uint8_t a[30];
312 uint8_t b[30];
313 uint8_t x[30];
314 uint8_t y[30];
315 uint8_t order[30];
316} _EC_X9_62_PRIME_239V1 = {
317 .seed = {
318 0xe4, 0x3b, 0xb4, 0x60, 0xf0, 0xb8, 0x0c, 0xc0, 0xc0, 0xb0,
319 0x75, 0x79, 0x8e, 0x94, 0x80, 0x60, 0xf8, 0x32, 0x1b, 0x7d,
320 },
321 .p = {
322 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
323 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00,
324 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff,
325 },
326 .a = {
327 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
328 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00,
329 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xfc,
330 },
331 .b = {
332 0x6b, 0x01, 0x6c, 0x3b, 0xdc, 0xf1, 0x89, 0x41, 0xd0, 0xd6,
333 0x54, 0x92, 0x14, 0x75, 0xca, 0x71, 0xa9, 0xdb, 0x2f, 0xb2,
334 0x7d, 0x1d, 0x37, 0x79, 0x61, 0x85, 0xc2, 0x94, 0x2c, 0x0a,
335 },
336 .x = {
337 0x0f, 0xfa, 0x96, 0x3c, 0xdc, 0xa8, 0x81, 0x6c, 0xcc, 0x33,
338 0xb8, 0x64, 0x2b, 0xed, 0xf9, 0x05, 0xc3, 0xd3, 0x58, 0x57,
339 0x3d, 0x3f, 0x27, 0xfb, 0xbd, 0x3b, 0x3c, 0xb9, 0xaa, 0xaf,
340 },
341 .y = {
342 0x7d, 0xeb, 0xe8, 0xe4, 0xe9, 0x0a, 0x5d, 0xae, 0x6e, 0x40,
343 0x54, 0xca, 0x53, 0x0b, 0xa0, 0x46, 0x54, 0xb3, 0x68, 0x18,
344 0xce, 0x22, 0x6b, 0x39, 0xfc, 0xcb, 0x7b, 0x02, 0xf1, 0xae,
345 },
346 .order = {
347 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
348 0xff, 0xff, 0x7f, 0xff, 0xff, 0x9e, 0x5e, 0x9a, 0x9f, 0x5d,
349 0x90, 0x71, 0xfb, 0xd1, 0x52, 0x26, 0x88, 0x90, 0x9d, 0x0b,
350 },
351};
352
353static const struct {
354 uint8_t seed[20];
355 uint8_t p[30];
356 uint8_t a[30];
357 uint8_t b[30];
358 uint8_t x[30];
359 uint8_t y[30];
360 uint8_t order[30];
361} _EC_X9_62_PRIME_239V2 = {
362 .seed = {
363 0xe8, 0xb4, 0x01, 0x16, 0x04, 0x09, 0x53, 0x03, 0xca, 0x3b,
364 0x80, 0x99, 0x98, 0x2b, 0xe0, 0x9f, 0xcb, 0x9a, 0xe6, 0x16,
365 },
366 .p = {
367 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
368 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00,
369 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff,
370 },
371 .a = {
372 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
373 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00,
374 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xfc,
375 },
376 .b = {
377 0x61, 0x7f, 0xab, 0x68, 0x32, 0x57, 0x6c, 0xbb, 0xfe, 0xd5,
378 0x0d, 0x99, 0xf0, 0x24, 0x9c, 0x3f, 0xee, 0x58, 0xb9, 0x4b,
379 0xa0, 0x03, 0x8c, 0x7a, 0xe8, 0x4c, 0x8c, 0x83, 0x2f, 0x2c,
380 },
381 .x = {
382 0x38, 0xaf, 0x09, 0xd9, 0x87, 0x27, 0x70, 0x51, 0x20, 0xc9,
383 0x21, 0xbb, 0x5e, 0x9e, 0x26, 0x29, 0x6a, 0x3c, 0xdc, 0xf2,
384 0xf3, 0x57, 0x57, 0xa0, 0xea, 0xfd, 0x87, 0xb8, 0x30, 0xe7,
385 },
386 .y = {
387 0x5b, 0x01, 0x25, 0xe4, 0xdb, 0xea, 0x0e, 0xc7, 0x20, 0x6d,
388 0xa0, 0xfc, 0x01, 0xd9, 0xb0, 0x81, 0x32, 0x9f, 0xb5, 0x55,
389 0xde, 0x6e, 0xf4, 0x60, 0x23, 0x7d, 0xff, 0x8b, 0xe4, 0xba,
390 },
391 .order = {
392 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
393 0xff, 0xff, 0x80, 0x00, 0x00, 0xcf, 0xa7, 0xe8, 0x59, 0x43,
394 0x77, 0xd4, 0x14, 0xc0, 0x38, 0x21, 0xbc, 0x58, 0x20, 0x63,
395 },
396};
397
398static const struct {
399 uint8_t seed[20];
400 uint8_t p[30];
401 uint8_t a[30];
402 uint8_t b[30];
403 uint8_t x[30];
404 uint8_t y[30];
405 uint8_t order[30];
406} _EC_X9_62_PRIME_239V3 = {
407 .seed = {
408 0x7d, 0x73, 0x74, 0x16, 0x8f, 0xfe, 0x34, 0x71, 0xb6, 0x0a,
409 0x85, 0x76, 0x86, 0xa1, 0x94, 0x75, 0xd3, 0xbf, 0xa2, 0xff,
410 },
411 .p = {
412 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
413 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00,
414 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff,
415 },
416 .a = {
417 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
418 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00,
419 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xfc,
420 },
421 .b = {
422 0x25, 0x57, 0x05, 0xfa, 0x2a, 0x30, 0x66, 0x54, 0xb1, 0xf4,
423 0xcb, 0x03, 0xd6, 0xa7, 0x50, 0xa3, 0x0c, 0x25, 0x01, 0x02,
424 0xd4, 0x98, 0x87, 0x17, 0xd9, 0xba, 0x15, 0xab, 0x6d, 0x3e,
425 },
426 .x = {
427 0x67, 0x68, 0xae, 0x8e, 0x18, 0xbb, 0x92, 0xcf, 0xcf, 0x00,
428 0x5c, 0x94, 0x9a, 0xa2, 0xc6, 0xd9, 0x48, 0x53, 0xd0, 0xe6,
429 0x60, 0xbb, 0xf8, 0x54, 0xb1, 0xc9, 0x50, 0x5f, 0xe9, 0x5a,
430 },
431 .y = {
432 0x16, 0x07, 0xe6, 0x89, 0x8f, 0x39, 0x0c, 0x06, 0xbc, 0x1d,
433 0x55, 0x2b, 0xad, 0x22, 0x6f, 0x3b, 0x6f, 0xcf, 0xe4, 0x8b,
434 0x6e, 0x81, 0x84, 0x99, 0xaf, 0x18, 0xe3, 0xed, 0x6c, 0xf3,
435 },
436 .order = {
437 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
438 0xff, 0xff, 0x7f, 0xff, 0xff, 0x97, 0x5d, 0xeb, 0x41, 0xb3,
439 0xa6, 0x05, 0x7c, 0x3c, 0x43, 0x21, 0x46, 0x52, 0x65, 0x51,
440 },
441};
442
443static const struct {
444 uint8_t p[29]; 309 uint8_t p[29];
445 uint8_t a[29]; 310 uint8_t a[29];
446 uint8_t b[29]; 311 uint8_t b[29];
@@ -1164,49 +1029,6 @@ static const struct ec_curve {
1164 .order = _EC_NIST_PRIME_521.order, 1029 .order = _EC_NIST_PRIME_521.order,
1165 .cofactor = 1, 1030 .cofactor = 1,
1166 }, 1031 },
1167 /* X9.62 curves */
1168 {
1169 .comment = "X9.62 curve prime239v1",
1170 .nid = NID_X9_62_prime239v1,
1171 .seed_len = sizeof(_EC_X9_62_PRIME_239V1.seed),
1172 .param_len = sizeof(_EC_X9_62_PRIME_239V1.p),
1173 .seed = _EC_X9_62_PRIME_239V1.seed,
1174 .p = _EC_X9_62_PRIME_239V1.p,
1175 .a = _EC_X9_62_PRIME_239V1.a,
1176 .b = _EC_X9_62_PRIME_239V1.b,
1177 .x = _EC_X9_62_PRIME_239V1.x,
1178 .y = _EC_X9_62_PRIME_239V1.y,
1179 .order = _EC_X9_62_PRIME_239V1.order,
1180 .cofactor = 1,
1181 },
1182 {
1183 .comment = "X9.62 curve prime239v2",
1184 .nid = NID_X9_62_prime239v2,
1185 .seed_len = sizeof(_EC_X9_62_PRIME_239V2.seed),
1186 .param_len = sizeof(_EC_X9_62_PRIME_239V2.p),
1187 .seed = _EC_X9_62_PRIME_239V2.seed,
1188 .p = _EC_X9_62_PRIME_239V2.p,
1189 .a = _EC_X9_62_PRIME_239V2.a,
1190 .b = _EC_X9_62_PRIME_239V2.b,
1191 .x = _EC_X9_62_PRIME_239V2.x,
1192 .y = _EC_X9_62_PRIME_239V2.y,
1193 .order = _EC_X9_62_PRIME_239V2.order,
1194 .cofactor = 1,
1195 },
1196 {
1197 .comment = "X9.62 curve prime239v3",
1198 .nid = NID_X9_62_prime239v3,
1199 .seed_len = sizeof(_EC_X9_62_PRIME_239V3.seed),
1200 .param_len = sizeof(_EC_X9_62_PRIME_239V3.p),
1201 .seed = _EC_X9_62_PRIME_239V3.seed,
1202 .p = _EC_X9_62_PRIME_239V3.p,
1203 .a = _EC_X9_62_PRIME_239V3.a,
1204 .b = _EC_X9_62_PRIME_239V3.b,
1205 .x = _EC_X9_62_PRIME_239V3.x,
1206 .y = _EC_X9_62_PRIME_239V3.y,
1207 .order = _EC_X9_62_PRIME_239V3.order,
1208 .cofactor = 1,
1209 },
1210 /* RFC 5639 curves */ 1032 /* RFC 5639 curves */
1211 { 1033 {
1212 .comment = "RFC 5639 curve brainpoolP224r1", 1034 .comment = "RFC 5639 curve brainpoolP224r1",