1636 lines
68 KiB
Diff
1636 lines
68 KiB
Diff
From 6cf74b032bc9f120a7c4924a0394d22f6ed4767b Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= <berrange@redhat.com>
|
|
Date: Fri, 1 Mar 2024 13:24:26 +0000
|
|
Subject: [PATCH 202/203] Disable various EC crypto features
|
|
MIME-Version: 1.0
|
|
Content-Type: text/plain; charset=UTF-8
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
Patches & policy copied from Fedora 39 openssl package.
|
|
|
|
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
|
|
---
|
|
Linux/build_openssl.sh | 11 +
|
|
...10-Add-changes-to-ectest-and-eccurve.patch | 1127 +++++++++++++++++
|
|
openssl_source/0011-Remove-EC-curves.patch | 236 ++++
|
|
openssl_source/0012-Disable-explicit-ec.patch | 208 +++
|
|
4 files changed, 1582 insertions(+)
|
|
create mode 100644 openssl_source/0010-Add-changes-to-ectest-and-eccurve.patch
|
|
create mode 100644 openssl_source/0011-Remove-EC-curves.patch
|
|
create mode 100644 openssl_source/0012-Disable-explicit-ec.patch
|
|
|
|
diff --git a/Linux/build_openssl.sh b/Linux/build_openssl.sh
|
|
index f2cf0b1..7470479 100755
|
|
--- a/Linux/build_openssl.sh
|
|
+++ b/Linux/build_openssl.sh
|
|
@@ -55,6 +55,17 @@ cd $SGXSSL_ROOT/../openssl_source || exit 1
|
|
rm -rf $OPENSSL_VERSION
|
|
tar xvf $OPENSSL_VERSION.tar.gz || exit 1
|
|
|
|
+# Disable forbidden EC
|
|
+(
|
|
+ cd $OPENSSL_VERSION
|
|
+
|
|
+ for i in $SGXSSL_ROOT/../openssl_source/*.patch
|
|
+ do
|
|
+ echo "Apply $i"
|
|
+ patch -p1 < $i
|
|
+ done
|
|
+)
|
|
+
|
|
# Remove AESBS to support only AESNI and VPAES
|
|
sed -i '/BSAES_ASM/d' $OPENSSL_VERSION/Configure
|
|
|
|
diff --git a/openssl_source/0010-Add-changes-to-ectest-and-eccurve.patch b/openssl_source/0010-Add-changes-to-ectest-and-eccurve.patch
|
|
new file mode 100644
|
|
index 0000000..aac242b
|
|
--- /dev/null
|
|
+++ b/openssl_source/0010-Add-changes-to-ectest-and-eccurve.patch
|
|
@@ -0,0 +1,1127 @@
|
|
+diff -up ./crypto/ec/ec_curve.c.remove-ec ./crypto/ec/ec_curve.c
|
|
+--- ./crypto/ec/ec_curve.c.remove-ec 2023-03-13 16:50:09.278933578 +0100
|
|
++++ ./crypto/ec/ec_curve.c 2023-03-21 12:38:57.696531941 +0100
|
|
+@@ -32,38 +32,6 @@ typedef struct {
|
|
+ /* the nist prime curves */
|
|
+ static const struct {
|
|
+ EC_CURVE_DATA h;
|
|
+- unsigned char data[20 + 24 * 6];
|
|
+-} _EC_NIST_PRIME_192 = {
|
|
+- {
|
|
+- NID_X9_62_prime_field, 20, 24, 1
|
|
+- },
|
|
+- {
|
|
+- /* seed */
|
|
+- 0x30, 0x45, 0xAE, 0x6F, 0xC8, 0x42, 0x2F, 0x64, 0xED, 0x57, 0x95, 0x28,
|
|
+- 0xD3, 0x81, 0x20, 0xEA, 0xE1, 0x21, 0x96, 0xD5,
|
|
+- /* p */
|
|
+- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
+- 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
+- /* a */
|
|
+- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
+- 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC,
|
|
+- /* b */
|
|
+- 0x64, 0x21, 0x05, 0x19, 0xE5, 0x9C, 0x80, 0xE7, 0x0F, 0xA7, 0xE9, 0xAB,
|
|
+- 0x72, 0x24, 0x30, 0x49, 0xFE, 0xB8, 0xDE, 0xEC, 0xC1, 0x46, 0xB9, 0xB1,
|
|
+- /* x */
|
|
+- 0x18, 0x8D, 0xA8, 0x0E, 0xB0, 0x30, 0x90, 0xF6, 0x7C, 0xBF, 0x20, 0xEB,
|
|
+- 0x43, 0xA1, 0x88, 0x00, 0xF4, 0xFF, 0x0A, 0xFD, 0x82, 0xFF, 0x10, 0x12,
|
|
+- /* y */
|
|
+- 0x07, 0x19, 0x2b, 0x95, 0xff, 0xc8, 0xda, 0x78, 0x63, 0x10, 0x11, 0xed,
|
|
+- 0x6b, 0x24, 0xcd, 0xd5, 0x73, 0xf9, 0x77, 0xa1, 0x1e, 0x79, 0x48, 0x11,
|
|
+- /* order */
|
|
+- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
+- 0x99, 0xDE, 0xF8, 0x36, 0x14, 0x6B, 0xC9, 0xB1, 0xB4, 0xD2, 0x28, 0x31
|
|
+- }
|
|
+-};
|
|
+-
|
|
+-static const struct {
|
|
+- EC_CURVE_DATA h;
|
|
+ unsigned char data[20 + 28 * 6];
|
|
+ } _EC_NIST_PRIME_224 = {
|
|
+ {
|
|
+@@ -200,187 +168,6 @@ static const struct {
|
|
+ }
|
|
+ };
|
|
+
|
|
+-# ifndef FIPS_MODULE
|
|
+-/* the x9.62 prime curves (minus the nist prime curves) */
|
|
+-static const struct {
|
|
+- EC_CURVE_DATA h;
|
|
+- unsigned char data[20 + 24 * 6];
|
|
+-} _EC_X9_62_PRIME_192V2 = {
|
|
+- {
|
|
+- NID_X9_62_prime_field, 20, 24, 1
|
|
+- },
|
|
+- {
|
|
+- /* seed */
|
|
+- 0x31, 0xA9, 0x2E, 0xE2, 0x02, 0x9F, 0xD1, 0x0D, 0x90, 0x1B, 0x11, 0x3E,
|
|
+- 0x99, 0x07, 0x10, 0xF0, 0xD2, 0x1A, 0xC6, 0xB6,
|
|
+- /* p */
|
|
+- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
+- 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
+- /* a */
|
|
+- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
+- 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC,
|
|
+- /* b */
|
|
+- 0xCC, 0x22, 0xD6, 0xDF, 0xB9, 0x5C, 0x6B, 0x25, 0xE4, 0x9C, 0x0D, 0x63,
|
|
+- 0x64, 0xA4, 0xE5, 0x98, 0x0C, 0x39, 0x3A, 0xA2, 0x16, 0x68, 0xD9, 0x53,
|
|
+- /* x */
|
|
+- 0xEE, 0xA2, 0xBA, 0xE7, 0xE1, 0x49, 0x78, 0x42, 0xF2, 0xDE, 0x77, 0x69,
|
|
+- 0xCF, 0xE9, 0xC9, 0x89, 0xC0, 0x72, 0xAD, 0x69, 0x6F, 0x48, 0x03, 0x4A,
|
|
+- /* y */
|
|
+- 0x65, 0x74, 0xd1, 0x1d, 0x69, 0xb6, 0xec, 0x7a, 0x67, 0x2b, 0xb8, 0x2a,
|
|
+- 0x08, 0x3d, 0xf2, 0xf2, 0xb0, 0x84, 0x7d, 0xe9, 0x70, 0xb2, 0xde, 0x15,
|
|
+- /* order */
|
|
+- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE,
|
|
+- 0x5F, 0xB1, 0xA7, 0x24, 0xDC, 0x80, 0x41, 0x86, 0x48, 0xD8, 0xDD, 0x31
|
|
+- }
|
|
+-};
|
|
+-
|
|
+-static const struct {
|
|
+- EC_CURVE_DATA h;
|
|
+- unsigned char data[20 + 24 * 6];
|
|
+-} _EC_X9_62_PRIME_192V3 = {
|
|
+- {
|
|
+- NID_X9_62_prime_field, 20, 24, 1
|
|
+- },
|
|
+- {
|
|
+- /* seed */
|
|
+- 0xC4, 0x69, 0x68, 0x44, 0x35, 0xDE, 0xB3, 0x78, 0xC4, 0xB6, 0x5C, 0xA9,
|
|
+- 0x59, 0x1E, 0x2A, 0x57, 0x63, 0x05, 0x9A, 0x2E,
|
|
+- /* p */
|
|
+- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
+- 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
+- /* a */
|
|
+- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
+- 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC,
|
|
+- /* b */
|
|
+- 0x22, 0x12, 0x3D, 0xC2, 0x39, 0x5A, 0x05, 0xCA, 0xA7, 0x42, 0x3D, 0xAE,
|
|
+- 0xCC, 0xC9, 0x47, 0x60, 0xA7, 0xD4, 0x62, 0x25, 0x6B, 0xD5, 0x69, 0x16,
|
|
+- /* x */
|
|
+- 0x7D, 0x29, 0x77, 0x81, 0x00, 0xC6, 0x5A, 0x1D, 0xA1, 0x78, 0x37, 0x16,
|
|
+- 0x58, 0x8D, 0xCE, 0x2B, 0x8B, 0x4A, 0xEE, 0x8E, 0x22, 0x8F, 0x18, 0x96,
|
|
+- /* y */
|
|
+- 0x38, 0xa9, 0x0f, 0x22, 0x63, 0x73, 0x37, 0x33, 0x4b, 0x49, 0xdc, 0xb6,
|
|
+- 0x6a, 0x6d, 0xc8, 0xf9, 0x97, 0x8a, 0xca, 0x76, 0x48, 0xa9, 0x43, 0xb0,
|
|
+- /* order */
|
|
+- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
+- 0x7A, 0x62, 0xD0, 0x31, 0xC8, 0x3F, 0x42, 0x94, 0xF6, 0x40, 0xEC, 0x13
|
|
+- }
|
|
+-};
|
|
+-
|
|
+-static const struct {
|
|
+- EC_CURVE_DATA h;
|
|
+- unsigned char data[20 + 30 * 6];
|
|
+-} _EC_X9_62_PRIME_239V1 = {
|
|
+- {
|
|
+- NID_X9_62_prime_field, 20, 30, 1
|
|
+- },
|
|
+- {
|
|
+- /* seed */
|
|
+- 0xE4, 0x3B, 0xB4, 0x60, 0xF0, 0xB8, 0x0C, 0xC0, 0xC0, 0xB0, 0x75, 0x79,
|
|
+- 0x8E, 0x94, 0x80, 0x60, 0xF8, 0x32, 0x1B, 0x7D,
|
|
+- /* p */
|
|
+- 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
+- 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
+- 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
+- /* a */
|
|
+- 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
+- 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
+- 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC,
|
|
+- /* b */
|
|
+- 0x6B, 0x01, 0x6C, 0x3B, 0xDC, 0xF1, 0x89, 0x41, 0xD0, 0xD6, 0x54, 0x92,
|
|
+- 0x14, 0x75, 0xCA, 0x71, 0xA9, 0xDB, 0x2F, 0xB2, 0x7D, 0x1D, 0x37, 0x79,
|
|
+- 0x61, 0x85, 0xC2, 0x94, 0x2C, 0x0A,
|
|
+- /* x */
|
|
+- 0x0F, 0xFA, 0x96, 0x3C, 0xDC, 0xA8, 0x81, 0x6C, 0xCC, 0x33, 0xB8, 0x64,
|
|
+- 0x2B, 0xED, 0xF9, 0x05, 0xC3, 0xD3, 0x58, 0x57, 0x3D, 0x3F, 0x27, 0xFB,
|
|
+- 0xBD, 0x3B, 0x3C, 0xB9, 0xAA, 0xAF,
|
|
+- /* y */
|
|
+- 0x7d, 0xeb, 0xe8, 0xe4, 0xe9, 0x0a, 0x5d, 0xae, 0x6e, 0x40, 0x54, 0xca,
|
|
+- 0x53, 0x0b, 0xa0, 0x46, 0x54, 0xb3, 0x68, 0x18, 0xce, 0x22, 0x6b, 0x39,
|
|
+- 0xfc, 0xcb, 0x7b, 0x02, 0xf1, 0xae,
|
|
+- /* order */
|
|
+- 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
+- 0x7F, 0xFF, 0xFF, 0x9E, 0x5E, 0x9A, 0x9F, 0x5D, 0x90, 0x71, 0xFB, 0xD1,
|
|
+- 0x52, 0x26, 0x88, 0x90, 0x9D, 0x0B
|
|
+- }
|
|
+-};
|
|
+-
|
|
+-static const struct {
|
|
+- EC_CURVE_DATA h;
|
|
+- unsigned char data[20 + 30 * 6];
|
|
+-} _EC_X9_62_PRIME_239V2 = {
|
|
+- {
|
|
+- NID_X9_62_prime_field, 20, 30, 1
|
|
+- },
|
|
+- {
|
|
+- /* seed */
|
|
+- 0xE8, 0xB4, 0x01, 0x16, 0x04, 0x09, 0x53, 0x03, 0xCA, 0x3B, 0x80, 0x99,
|
|
+- 0x98, 0x2B, 0xE0, 0x9F, 0xCB, 0x9A, 0xE6, 0x16,
|
|
+- /* p */
|
|
+- 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
+- 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
+- 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
+- /* a */
|
|
+- 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
+- 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
+- 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC,
|
|
+- /* b */
|
|
+- 0x61, 0x7F, 0xAB, 0x68, 0x32, 0x57, 0x6C, 0xBB, 0xFE, 0xD5, 0x0D, 0x99,
|
|
+- 0xF0, 0x24, 0x9C, 0x3F, 0xEE, 0x58, 0xB9, 0x4B, 0xA0, 0x03, 0x8C, 0x7A,
|
|
+- 0xE8, 0x4C, 0x8C, 0x83, 0x2F, 0x2C,
|
|
+- /* x */
|
|
+- 0x38, 0xAF, 0x09, 0xD9, 0x87, 0x27, 0x70, 0x51, 0x20, 0xC9, 0x21, 0xBB,
|
|
+- 0x5E, 0x9E, 0x26, 0x29, 0x6A, 0x3C, 0xDC, 0xF2, 0xF3, 0x57, 0x57, 0xA0,
|
|
+- 0xEA, 0xFD, 0x87, 0xB8, 0x30, 0xE7,
|
|
+- /* y */
|
|
+- 0x5b, 0x01, 0x25, 0xe4, 0xdb, 0xea, 0x0e, 0xc7, 0x20, 0x6d, 0xa0, 0xfc,
|
|
+- 0x01, 0xd9, 0xb0, 0x81, 0x32, 0x9f, 0xb5, 0x55, 0xde, 0x6e, 0xf4, 0x60,
|
|
+- 0x23, 0x7d, 0xff, 0x8b, 0xe4, 0xba,
|
|
+- /* order */
|
|
+- 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
+- 0x80, 0x00, 0x00, 0xCF, 0xA7, 0xE8, 0x59, 0x43, 0x77, 0xD4, 0x14, 0xC0,
|
|
+- 0x38, 0x21, 0xBC, 0x58, 0x20, 0x63
|
|
+- }
|
|
+-};
|
|
+-
|
|
+-static const struct {
|
|
+- EC_CURVE_DATA h;
|
|
+- unsigned char data[20 + 30 * 6];
|
|
+-} _EC_X9_62_PRIME_239V3 = {
|
|
+- {
|
|
+- NID_X9_62_prime_field, 20, 30, 1
|
|
+- },
|
|
+- {
|
|
+- /* seed */
|
|
+- 0x7D, 0x73, 0x74, 0x16, 0x8F, 0xFE, 0x34, 0x71, 0xB6, 0x0A, 0x85, 0x76,
|
|
+- 0x86, 0xA1, 0x94, 0x75, 0xD3, 0xBF, 0xA2, 0xFF,
|
|
+- /* p */
|
|
+- 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
+- 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
+- 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
+- /* a */
|
|
+- 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
+- 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
+- 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC,
|
|
+- /* b */
|
|
+- 0x25, 0x57, 0x05, 0xFA, 0x2A, 0x30, 0x66, 0x54, 0xB1, 0xF4, 0xCB, 0x03,
|
|
+- 0xD6, 0xA7, 0x50, 0xA3, 0x0C, 0x25, 0x01, 0x02, 0xD4, 0x98, 0x87, 0x17,
|
|
+- 0xD9, 0xBA, 0x15, 0xAB, 0x6D, 0x3E,
|
|
+- /* x */
|
|
+- 0x67, 0x68, 0xAE, 0x8E, 0x18, 0xBB, 0x92, 0xCF, 0xCF, 0x00, 0x5C, 0x94,
|
|
+- 0x9A, 0xA2, 0xC6, 0xD9, 0x48, 0x53, 0xD0, 0xE6, 0x60, 0xBB, 0xF8, 0x54,
|
|
+- 0xB1, 0xC9, 0x50, 0x5F, 0xE9, 0x5A,
|
|
+- /* y */
|
|
+- 0x16, 0x07, 0xe6, 0x89, 0x8f, 0x39, 0x0c, 0x06, 0xbc, 0x1d, 0x55, 0x2b,
|
|
+- 0xad, 0x22, 0x6f, 0x3b, 0x6f, 0xcf, 0xe4, 0x8b, 0x6e, 0x81, 0x84, 0x99,
|
|
+- 0xaf, 0x18, 0xe3, 0xed, 0x6c, 0xf3,
|
|
+- /* order */
|
|
+- 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
+- 0x7F, 0xFF, 0xFF, 0x97, 0x5D, 0xEB, 0x41, 0xB3, 0xA6, 0x05, 0x7C, 0x3C,
|
|
+- 0x43, 0x21, 0x46, 0x52, 0x65, 0x51
|
|
+- }
|
|
+-};
|
|
+-#endif /* FIPS_MODULE */
|
|
+-
|
|
+ static const struct {
|
|
+ EC_CURVE_DATA h;
|
|
+ unsigned char data[20 + 32 * 6];
|
|
+@@ -423,294 +210,6 @@ static const struct {
|
|
+ /* the secg prime curves (minus the nist and x9.62 prime curves) */
|
|
+ static const struct {
|
|
+ EC_CURVE_DATA h;
|
|
+- unsigned char data[20 + 14 * 6];
|
|
+-} _EC_SECG_PRIME_112R1 = {
|
|
+- {
|
|
+- NID_X9_62_prime_field, 20, 14, 1
|
|
+- },
|
|
+- {
|
|
+- /* seed */
|
|
+- 0x00, 0xF5, 0x0B, 0x02, 0x8E, 0x4D, 0x69, 0x6E, 0x67, 0x68, 0x75, 0x61,
|
|
+- 0x51, 0x75, 0x29, 0x04, 0x72, 0x78, 0x3F, 0xB1,
|
|
+- /* p */
|
|
+- 0xDB, 0x7C, 0x2A, 0xBF, 0x62, 0xE3, 0x5E, 0x66, 0x80, 0x76, 0xBE, 0xAD,
|
|
+- 0x20, 0x8B,
|
|
+- /* a */
|
|
+- 0xDB, 0x7C, 0x2A, 0xBF, 0x62, 0xE3, 0x5E, 0x66, 0x80, 0x76, 0xBE, 0xAD,
|
|
+- 0x20, 0x88,
|
|
+- /* b */
|
|
+- 0x65, 0x9E, 0xF8, 0xBA, 0x04, 0x39, 0x16, 0xEE, 0xDE, 0x89, 0x11, 0x70,
|
|
+- 0x2B, 0x22,
|
|
+- /* x */
|
|
+- 0x09, 0x48, 0x72, 0x39, 0x99, 0x5A, 0x5E, 0xE7, 0x6B, 0x55, 0xF9, 0xC2,
|
|
+- 0xF0, 0x98,
|
|
+- /* y */
|
|
+- 0xa8, 0x9c, 0xe5, 0xaf, 0x87, 0x24, 0xc0, 0xa2, 0x3e, 0x0e, 0x0f, 0xf7,
|
|
+- 0x75, 0x00,
|
|
+- /* order */
|
|
+- 0xDB, 0x7C, 0x2A, 0xBF, 0x62, 0xE3, 0x5E, 0x76, 0x28, 0xDF, 0xAC, 0x65,
|
|
+- 0x61, 0xC5
|
|
+- }
|
|
+-};
|
|
+-
|
|
+-static const struct {
|
|
+- EC_CURVE_DATA h;
|
|
+- unsigned char data[20 + 14 * 6];
|
|
+-} _EC_SECG_PRIME_112R2 = {
|
|
+- {
|
|
+- NID_X9_62_prime_field, 20, 14, 4
|
|
+- },
|
|
+- {
|
|
+- /* seed */
|
|
+- 0x00, 0x27, 0x57, 0xA1, 0x11, 0x4D, 0x69, 0x6E, 0x67, 0x68, 0x75, 0x61,
|
|
+- 0x51, 0x75, 0x53, 0x16, 0xC0, 0x5E, 0x0B, 0xD4,
|
|
+- /* p */
|
|
+- 0xDB, 0x7C, 0x2A, 0xBF, 0x62, 0xE3, 0x5E, 0x66, 0x80, 0x76, 0xBE, 0xAD,
|
|
+- 0x20, 0x8B,
|
|
+- /* a */
|
|
+- 0x61, 0x27, 0xC2, 0x4C, 0x05, 0xF3, 0x8A, 0x0A, 0xAA, 0xF6, 0x5C, 0x0E,
|
|
+- 0xF0, 0x2C,
|
|
+- /* b */
|
|
+- 0x51, 0xDE, 0xF1, 0x81, 0x5D, 0xB5, 0xED, 0x74, 0xFC, 0xC3, 0x4C, 0x85,
|
|
+- 0xD7, 0x09,
|
|
+- /* x */
|
|
+- 0x4B, 0xA3, 0x0A, 0xB5, 0xE8, 0x92, 0xB4, 0xE1, 0x64, 0x9D, 0xD0, 0x92,
|
|
+- 0x86, 0x43,
|
|
+- /* y */
|
|
+- 0xad, 0xcd, 0x46, 0xf5, 0x88, 0x2e, 0x37, 0x47, 0xde, 0xf3, 0x6e, 0x95,
|
|
+- 0x6e, 0x97,
|
|
+- /* order */
|
|
+- 0x36, 0xDF, 0x0A, 0xAF, 0xD8, 0xB8, 0xD7, 0x59, 0x7C, 0xA1, 0x05, 0x20,
|
|
+- 0xD0, 0x4B
|
|
+- }
|
|
+-};
|
|
+-
|
|
+-static const struct {
|
|
+- EC_CURVE_DATA h;
|
|
+- unsigned char data[20 + 16 * 6];
|
|
+-} _EC_SECG_PRIME_128R1 = {
|
|
+- {
|
|
+- NID_X9_62_prime_field, 20, 16, 1
|
|
+- },
|
|
+- {
|
|
+- /* seed */
|
|
+- 0x00, 0x0E, 0x0D, 0x4D, 0x69, 0x6E, 0x67, 0x68, 0x75, 0x61, 0x51, 0x75,
|
|
+- 0x0C, 0xC0, 0x3A, 0x44, 0x73, 0xD0, 0x36, 0x79,
|
|
+- /* p */
|
|
+- 0xFF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
+- 0xFF, 0xFF, 0xFF, 0xFF,
|
|
+- /* a */
|
|
+- 0xFF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
+- 0xFF, 0xFF, 0xFF, 0xFC,
|
|
+- /* b */
|
|
+- 0xE8, 0x75, 0x79, 0xC1, 0x10, 0x79, 0xF4, 0x3D, 0xD8, 0x24, 0x99, 0x3C,
|
|
+- 0x2C, 0xEE, 0x5E, 0xD3,
|
|
+- /* x */
|
|
+- 0x16, 0x1F, 0xF7, 0x52, 0x8B, 0x89, 0x9B, 0x2D, 0x0C, 0x28, 0x60, 0x7C,
|
|
+- 0xA5, 0x2C, 0x5B, 0x86,
|
|
+- /* y */
|
|
+- 0xcf, 0x5a, 0xc8, 0x39, 0x5b, 0xaf, 0xeb, 0x13, 0xc0, 0x2d, 0xa2, 0x92,
|
|
+- 0xdd, 0xed, 0x7a, 0x83,
|
|
+- /* order */
|
|
+- 0xFF, 0xFF, 0xFF, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x75, 0xA3, 0x0D, 0x1B,
|
|
+- 0x90, 0x38, 0xA1, 0x15
|
|
+- }
|
|
+-};
|
|
+-
|
|
+-static const struct {
|
|
+- EC_CURVE_DATA h;
|
|
+- unsigned char data[20 + 16 * 6];
|
|
+-} _EC_SECG_PRIME_128R2 = {
|
|
+- {
|
|
+- NID_X9_62_prime_field, 20, 16, 4
|
|
+- },
|
|
+- {
|
|
+- /* seed */
|
|
+- 0x00, 0x4D, 0x69, 0x6E, 0x67, 0x68, 0x75, 0x61, 0x51, 0x75, 0x12, 0xD8,
|
|
+- 0xF0, 0x34, 0x31, 0xFC, 0xE6, 0x3B, 0x88, 0xF4,
|
|
+- /* p */
|
|
+- 0xFF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
+- 0xFF, 0xFF, 0xFF, 0xFF,
|
|
+- /* a */
|
|
+- 0xD6, 0x03, 0x19, 0x98, 0xD1, 0xB3, 0xBB, 0xFE, 0xBF, 0x59, 0xCC, 0x9B,
|
|
+- 0xBF, 0xF9, 0xAE, 0xE1,
|
|
+- /* b */
|
|
+- 0x5E, 0xEE, 0xFC, 0xA3, 0x80, 0xD0, 0x29, 0x19, 0xDC, 0x2C, 0x65, 0x58,
|
|
+- 0xBB, 0x6D, 0x8A, 0x5D,
|
|
+- /* x */
|
|
+- 0x7B, 0x6A, 0xA5, 0xD8, 0x5E, 0x57, 0x29, 0x83, 0xE6, 0xFB, 0x32, 0xA7,
|
|
+- 0xCD, 0xEB, 0xC1, 0x40,
|
|
+- /* y */
|
|
+- 0x27, 0xb6, 0x91, 0x6a, 0x89, 0x4d, 0x3a, 0xee, 0x71, 0x06, 0xfe, 0x80,
|
|
+- 0x5f, 0xc3, 0x4b, 0x44,
|
|
+- /* order */
|
|
+- 0x3F, 0xFF, 0xFF, 0xFF, 0x7F, 0xFF, 0xFF, 0xFF, 0xBE, 0x00, 0x24, 0x72,
|
|
+- 0x06, 0x13, 0xB5, 0xA3
|
|
+- }
|
|
+-};
|
|
+-
|
|
+-static const struct {
|
|
+- EC_CURVE_DATA h;
|
|
+- unsigned char data[0 + 21 * 6];
|
|
+-} _EC_SECG_PRIME_160K1 = {
|
|
+- {
|
|
+- NID_X9_62_prime_field, 0, 21, 1
|
|
+- },
|
|
+- {
|
|
+- /* no seed */
|
|
+- /* p */
|
|
+- 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
+- 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xAC, 0x73,
|
|
+- /* a */
|
|
+- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
+- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
+- /* b */
|
|
+- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
+- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07,
|
|
+- /* x */
|
|
+- 0x00, 0x3B, 0x4C, 0x38, 0x2C, 0xE3, 0x7A, 0xA1, 0x92, 0xA4, 0x01, 0x9E,
|
|
+- 0x76, 0x30, 0x36, 0xF4, 0xF5, 0xDD, 0x4D, 0x7E, 0xBB,
|
|
+- /* y */
|
|
+- 0x00, 0x93, 0x8c, 0xf9, 0x35, 0x31, 0x8f, 0xdc, 0xed, 0x6b, 0xc2, 0x82,
|
|
+- 0x86, 0x53, 0x17, 0x33, 0xc3, 0xf0, 0x3c, 0x4f, 0xee,
|
|
+- /* order */
|
|
+- 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xB8,
|
|
+- 0xFA, 0x16, 0xDF, 0xAB, 0x9A, 0xCA, 0x16, 0xB6, 0xB3
|
|
+- }
|
|
+-};
|
|
+-
|
|
+-static const struct {
|
|
+- EC_CURVE_DATA h;
|
|
+- unsigned char data[20 + 21 * 6];
|
|
+-} _EC_SECG_PRIME_160R1 = {
|
|
+- {
|
|
+- NID_X9_62_prime_field, 20, 21, 1
|
|
+- },
|
|
+- {
|
|
+- /* seed */
|
|
+- 0x10, 0x53, 0xCD, 0xE4, 0x2C, 0x14, 0xD6, 0x96, 0xE6, 0x76, 0x87, 0x56,
|
|
+- 0x15, 0x17, 0x53, 0x3B, 0xF3, 0xF8, 0x33, 0x45,
|
|
+- /* p */
|
|
+- 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
+- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0xFF, 0xFF, 0xFF,
|
|
+- /* a */
|
|
+- 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
+- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0xFF, 0xFF, 0xFC,
|
|
+- /* b */
|
|
+- 0x00, 0x1C, 0x97, 0xBE, 0xFC, 0x54, 0xBD, 0x7A, 0x8B, 0x65, 0xAC, 0xF8,
|
|
+- 0x9F, 0x81, 0xD4, 0xD4, 0xAD, 0xC5, 0x65, 0xFA, 0x45,
|
|
+- /* x */
|
|
+- 0x00, 0x4A, 0x96, 0xB5, 0x68, 0x8E, 0xF5, 0x73, 0x28, 0x46, 0x64, 0x69,
|
|
+- 0x89, 0x68, 0xC3, 0x8B, 0xB9, 0x13, 0xCB, 0xFC, 0x82,
|
|
+- /* y */
|
|
+- 0x00, 0x23, 0xa6, 0x28, 0x55, 0x31, 0x68, 0x94, 0x7d, 0x59, 0xdc, 0xc9,
|
|
+- 0x12, 0x04, 0x23, 0x51, 0x37, 0x7a, 0xc5, 0xfb, 0x32,
|
|
+- /* order */
|
|
+- 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xF4,
|
|
+- 0xC8, 0xF9, 0x27, 0xAE, 0xD3, 0xCA, 0x75, 0x22, 0x57
|
|
+- }
|
|
+-};
|
|
+-
|
|
+-static const struct {
|
|
+- EC_CURVE_DATA h;
|
|
+- unsigned char data[20 + 21 * 6];
|
|
+-} _EC_SECG_PRIME_160R2 = {
|
|
+- {
|
|
+- NID_X9_62_prime_field, 20, 21, 1
|
|
+- },
|
|
+- {
|
|
+- /* seed */
|
|
+- 0xB9, 0x9B, 0x99, 0xB0, 0x99, 0xB3, 0x23, 0xE0, 0x27, 0x09, 0xA4, 0xD6,
|
|
+- 0x96, 0xE6, 0x76, 0x87, 0x56, 0x15, 0x17, 0x51,
|
|
+- /* p */
|
|
+- 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
+- 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xAC, 0x73,
|
|
+- /* a */
|
|
+- 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
+- 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xAC, 0x70,
|
|
+- /* b */
|
|
+- 0x00, 0xB4, 0xE1, 0x34, 0xD3, 0xFB, 0x59, 0xEB, 0x8B, 0xAB, 0x57, 0x27,
|
|
+- 0x49, 0x04, 0x66, 0x4D, 0x5A, 0xF5, 0x03, 0x88, 0xBA,
|
|
+- /* x */
|
|
+- 0x00, 0x52, 0xDC, 0xB0, 0x34, 0x29, 0x3A, 0x11, 0x7E, 0x1F, 0x4F, 0xF1,
|
|
+- 0x1B, 0x30, 0xF7, 0x19, 0x9D, 0x31, 0x44, 0xCE, 0x6D,
|
|
+- /* y */
|
|
+- 0x00, 0xfe, 0xaf, 0xfe, 0xf2, 0xe3, 0x31, 0xf2, 0x96, 0xe0, 0x71, 0xfa,
|
|
+- 0x0d, 0xf9, 0x98, 0x2c, 0xfe, 0xa7, 0xd4, 0x3f, 0x2e,
|
|
+- /* order */
|
|
+- 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x35,
|
|
+- 0x1E, 0xE7, 0x86, 0xA8, 0x18, 0xF3, 0xA1, 0xA1, 0x6B
|
|
+- }
|
|
+-};
|
|
+-
|
|
+-static const struct {
|
|
+- EC_CURVE_DATA h;
|
|
+- unsigned char data[0 + 24 * 6];
|
|
+-} _EC_SECG_PRIME_192K1 = {
|
|
+- {
|
|
+- NID_X9_62_prime_field, 0, 24, 1
|
|
+- },
|
|
+- {
|
|
+- /* no seed */
|
|
+- /* p */
|
|
+- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
+- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xEE, 0x37,
|
|
+- /* a */
|
|
+- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
+- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
+- /* b */
|
|
+- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
+- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,
|
|
+- /* x */
|
|
+- 0xDB, 0x4F, 0xF1, 0x0E, 0xC0, 0x57, 0xE9, 0xAE, 0x26, 0xB0, 0x7D, 0x02,
|
|
+- 0x80, 0xB7, 0xF4, 0x34, 0x1D, 0xA5, 0xD1, 0xB1, 0xEA, 0xE0, 0x6C, 0x7D,
|
|
+- /* y */
|
|
+- 0x9b, 0x2f, 0x2f, 0x6d, 0x9c, 0x56, 0x28, 0xa7, 0x84, 0x41, 0x63, 0xd0,
|
|
+- 0x15, 0xbe, 0x86, 0x34, 0x40, 0x82, 0xaa, 0x88, 0xd9, 0x5e, 0x2f, 0x9d,
|
|
+- /* order */
|
|
+- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE,
|
|
+- 0x26, 0xF2, 0xFC, 0x17, 0x0F, 0x69, 0x46, 0x6A, 0x74, 0xDE, 0xFD, 0x8D
|
|
+- }
|
|
+-};
|
|
+-
|
|
+-static const struct {
|
|
+- EC_CURVE_DATA h;
|
|
+- unsigned char data[0 + 29 * 6];
|
|
+-} _EC_SECG_PRIME_224K1 = {
|
|
+- {
|
|
+- NID_X9_62_prime_field, 0, 29, 1
|
|
+- },
|
|
+- {
|
|
+- /* no seed */
|
|
+- /* p */
|
|
+- 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
+- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
+- 0xFE, 0xFF, 0xFF, 0xE5, 0x6D,
|
|
+- /* a */
|
|
+- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
+- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
+- 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
+- /* b */
|
|
+- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
+- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
+- 0x00, 0x00, 0x00, 0x00, 0x05,
|
|
+- /* x */
|
|
+- 0x00, 0xA1, 0x45, 0x5B, 0x33, 0x4D, 0xF0, 0x99, 0xDF, 0x30, 0xFC, 0x28,
|
|
+- 0xA1, 0x69, 0xA4, 0x67, 0xE9, 0xE4, 0x70, 0x75, 0xA9, 0x0F, 0x7E, 0x65,
|
|
+- 0x0E, 0xB6, 0xB7, 0xA4, 0x5C,
|
|
+- /* y */
|
|
+- 0x00, 0x7e, 0x08, 0x9f, 0xed, 0x7f, 0xba, 0x34, 0x42, 0x82, 0xca, 0xfb,
|
|
+- 0xd6, 0xf7, 0xe3, 0x19, 0xf7, 0xc0, 0xb0, 0xbd, 0x59, 0xe2, 0xca, 0x4b,
|
|
+- 0xdb, 0x55, 0x6d, 0x61, 0xa5,
|
|
+- /* order */
|
|
+- 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
+- 0x00, 0x00, 0x01, 0xDC, 0xE8, 0xD2, 0xEC, 0x61, 0x84, 0xCA, 0xF0, 0xA9,
|
|
+- 0x71, 0x76, 0x9F, 0xB1, 0xF7
|
|
+- }
|
|
+-};
|
|
+-
|
|
+-static const struct {
|
|
+- EC_CURVE_DATA h;
|
|
+ unsigned char data[0 + 32 * 6];
|
|
+ } _EC_SECG_PRIME_256K1 = {
|
|
+ {
|
|
+@@ -745,102 +244,6 @@ static const struct {
|
|
+ }
|
|
+ };
|
|
+
|
|
+-/* some wap/wtls curves */
|
|
+-static const struct {
|
|
+- EC_CURVE_DATA h;
|
|
+- unsigned char data[0 + 15 * 6];
|
|
+-} _EC_WTLS_8 = {
|
|
+- {
|
|
+- NID_X9_62_prime_field, 0, 15, 1
|
|
+- },
|
|
+- {
|
|
+- /* no seed */
|
|
+- /* p */
|
|
+- 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
+- 0xFF, 0xFD, 0xE7,
|
|
+- /* a */
|
|
+- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
+- 0x00, 0x00, 0x00,
|
|
+- /* b */
|
|
+- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
+- 0x00, 0x00, 0x03,
|
|
+- /* x */
|
|
+- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
+- 0x00, 0x00, 0x01,
|
|
+- /* y */
|
|
+- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
+- 0x00, 0x00, 0x02,
|
|
+- /* order */
|
|
+- 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xEC, 0xEA, 0x55, 0x1A,
|
|
+- 0xD8, 0x37, 0xE9
|
|
+- }
|
|
+-};
|
|
+-
|
|
+-static const struct {
|
|
+- EC_CURVE_DATA h;
|
|
+- unsigned char data[0 + 21 * 6];
|
|
+-} _EC_WTLS_9 = {
|
|
+- {
|
|
+- NID_X9_62_prime_field, 0, 21, 1
|
|
+- },
|
|
+- {
|
|
+- /* no seed */
|
|
+- /* p */
|
|
+- 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
+- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0x80, 0x8F,
|
|
+- /* a */
|
|
+- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
+- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
+- /* b */
|
|
+- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
+- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,
|
|
+- /* x */
|
|
+- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
+- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
|
|
+- /* y */
|
|
+- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
+- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
|
|
+- /* order */
|
|
+- 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xCD,
|
|
+- 0xC9, 0x8A, 0xE0, 0xE2, 0xDE, 0x57, 0x4A, 0xBF, 0x33
|
|
+- }
|
|
+-};
|
|
+-
|
|
+-static const struct {
|
|
+- EC_CURVE_DATA h;
|
|
+- unsigned char data[0 + 28 * 6];
|
|
+-} _EC_WTLS_12 = {
|
|
+- {
|
|
+- NID_X9_62_prime_field, 0, 28, 1
|
|
+- },
|
|
+- {
|
|
+- /* no seed */
|
|
+- /* p */
|
|
+- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
+- 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
+- 0x00, 0x00, 0x00, 0x01,
|
|
+- /* a */
|
|
+- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
+- 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
+- 0xFF, 0xFF, 0xFF, 0xFE,
|
|
+- /* b */
|
|
+- 0xB4, 0x05, 0x0A, 0x85, 0x0C, 0x04, 0xB3, 0xAB, 0xF5, 0x41, 0x32, 0x56,
|
|
+- 0x50, 0x44, 0xB0, 0xB7, 0xD7, 0xBF, 0xD8, 0xBA, 0x27, 0x0B, 0x39, 0x43,
|
|
+- 0x23, 0x55, 0xFF, 0xB4,
|
|
+- /* x */
|
|
+- 0xB7, 0x0E, 0x0C, 0xBD, 0x6B, 0xB4, 0xBF, 0x7F, 0x32, 0x13, 0x90, 0xB9,
|
|
+- 0x4A, 0x03, 0xC1, 0xD3, 0x56, 0xC2, 0x11, 0x22, 0x34, 0x32, 0x80, 0xD6,
|
|
+- 0x11, 0x5C, 0x1D, 0x21,
|
|
+- /* y */
|
|
+- 0xbd, 0x37, 0x63, 0x88, 0xb5, 0xf7, 0x23, 0xfb, 0x4c, 0x22, 0xdf, 0xe6,
|
|
+- 0xcd, 0x43, 0x75, 0xa0, 0x5a, 0x07, 0x47, 0x64, 0x44, 0xd5, 0x81, 0x99,
|
|
+- 0x85, 0x00, 0x7e, 0x34,
|
|
+- /* order */
|
|
+- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
+- 0xFF, 0xFF, 0x16, 0xA2, 0xE0, 0xB8, 0xF0, 0x3E, 0x13, 0xDD, 0x29, 0x45,
|
|
+- 0x5C, 0x5C, 0x2A, 0x3D
|
|
+- }
|
|
+-};
|
|
+ #endif /* FIPS_MODULE */
|
|
+
|
|
+ #ifndef OPENSSL_NO_EC2M
|
|
+@@ -2238,198 +1641,6 @@ static const struct {
|
|
+ #ifndef FIPS_MODULE
|
|
+ static const struct {
|
|
+ EC_CURVE_DATA h;
|
|
+- unsigned char data[0 + 20 * 6];
|
|
+-} _EC_brainpoolP160r1 = {
|
|
+- {
|
|
+- NID_X9_62_prime_field, 0, 20, 1
|
|
+- },
|
|
+- {
|
|
+- /* no seed */
|
|
+- /* p */
|
|
+- 0xE9, 0x5E, 0x4A, 0x5F, 0x73, 0x70, 0x59, 0xDC, 0x60, 0xDF, 0xC7, 0xAD,
|
|
+- 0x95, 0xB3, 0xD8, 0x13, 0x95, 0x15, 0x62, 0x0F,
|
|
+- /* a */
|
|
+- 0x34, 0x0E, 0x7B, 0xE2, 0xA2, 0x80, 0xEB, 0x74, 0xE2, 0xBE, 0x61, 0xBA,
|
|
+- 0xDA, 0x74, 0x5D, 0x97, 0xE8, 0xF7, 0xC3, 0x00,
|
|
+- /* b */
|
|
+- 0x1E, 0x58, 0x9A, 0x85, 0x95, 0x42, 0x34, 0x12, 0x13, 0x4F, 0xAA, 0x2D,
|
|
+- 0xBD, 0xEC, 0x95, 0xC8, 0xD8, 0x67, 0x5E, 0x58,
|
|
+- /* x */
|
|
+- 0xBE, 0xD5, 0xAF, 0x16, 0xEA, 0x3F, 0x6A, 0x4F, 0x62, 0x93, 0x8C, 0x46,
|
|
+- 0x31, 0xEB, 0x5A, 0xF7, 0xBD, 0xBC, 0xDB, 0xC3,
|
|
+- /* y */
|
|
+- 0x16, 0x67, 0xCB, 0x47, 0x7A, 0x1A, 0x8E, 0xC3, 0x38, 0xF9, 0x47, 0x41,
|
|
+- 0x66, 0x9C, 0x97, 0x63, 0x16, 0xDA, 0x63, 0x21,
|
|
+- /* order */
|
|
+- 0xE9, 0x5E, 0x4A, 0x5F, 0x73, 0x70, 0x59, 0xDC, 0x60, 0xDF, 0x59, 0x91,
|
|
+- 0xD4, 0x50, 0x29, 0x40, 0x9E, 0x60, 0xFC, 0x09
|
|
+- }
|
|
+-};
|
|
+-
|
|
+-static const struct {
|
|
+- EC_CURVE_DATA h;
|
|
+- unsigned char data[0 + 20 * 6];
|
|
+-} _EC_brainpoolP160t1 = {
|
|
+- {
|
|
+- NID_X9_62_prime_field, 0, 20, 1
|
|
+- },
|
|
+- {
|
|
+- /* no seed */
|
|
+- /* p */
|
|
+- 0xE9, 0x5E, 0x4A, 0x5F, 0x73, 0x70, 0x59, 0xDC, 0x60, 0xDF, 0xC7, 0xAD,
|
|
+- 0x95, 0xB3, 0xD8, 0x13, 0x95, 0x15, 0x62, 0x0F,
|
|
+- /* a */
|
|
+- 0xE9, 0x5E, 0x4A, 0x5F, 0x73, 0x70, 0x59, 0xDC, 0x60, 0xDF, 0xC7, 0xAD,
|
|
+- 0x95, 0xB3, 0xD8, 0x13, 0x95, 0x15, 0x62, 0x0C,
|
|
+- /* b */
|
|
+- 0x7A, 0x55, 0x6B, 0x6D, 0xAE, 0x53, 0x5B, 0x7B, 0x51, 0xED, 0x2C, 0x4D,
|
|
+- 0x7D, 0xAA, 0x7A, 0x0B, 0x5C, 0x55, 0xF3, 0x80,
|
|
+- /* x */
|
|
+- 0xB1, 0x99, 0xB1, 0x3B, 0x9B, 0x34, 0xEF, 0xC1, 0x39, 0x7E, 0x64, 0xBA,
|
|
+- 0xEB, 0x05, 0xAC, 0xC2, 0x65, 0xFF, 0x23, 0x78,
|
|
+- /* y */
|
|
+- 0xAD, 0xD6, 0x71, 0x8B, 0x7C, 0x7C, 0x19, 0x61, 0xF0, 0x99, 0x1B, 0x84,
|
|
+- 0x24, 0x43, 0x77, 0x21, 0x52, 0xC9, 0xE0, 0xAD,
|
|
+- /* order */
|
|
+- 0xE9, 0x5E, 0x4A, 0x5F, 0x73, 0x70, 0x59, 0xDC, 0x60, 0xDF, 0x59, 0x91,
|
|
+- 0xD4, 0x50, 0x29, 0x40, 0x9E, 0x60, 0xFC, 0x09
|
|
+- }
|
|
+-};
|
|
+-
|
|
+-static const struct {
|
|
+- EC_CURVE_DATA h;
|
|
+- unsigned char data[0 + 24 * 6];
|
|
+-} _EC_brainpoolP192r1 = {
|
|
+- {
|
|
+- NID_X9_62_prime_field, 0, 24, 1
|
|
+- },
|
|
+- {
|
|
+- /* no seed */
|
|
+- /* p */
|
|
+- 0xC3, 0x02, 0xF4, 0x1D, 0x93, 0x2A, 0x36, 0xCD, 0xA7, 0xA3, 0x46, 0x30,
|
|
+- 0x93, 0xD1, 0x8D, 0xB7, 0x8F, 0xCE, 0x47, 0x6D, 0xE1, 0xA8, 0x62, 0x97,
|
|
+- /* a */
|
|
+- 0x6A, 0x91, 0x17, 0x40, 0x76, 0xB1, 0xE0, 0xE1, 0x9C, 0x39, 0xC0, 0x31,
|
|
+- 0xFE, 0x86, 0x85, 0xC1, 0xCA, 0xE0, 0x40, 0xE5, 0xC6, 0x9A, 0x28, 0xEF,
|
|
+- /* b */
|
|
+- 0x46, 0x9A, 0x28, 0xEF, 0x7C, 0x28, 0xCC, 0xA3, 0xDC, 0x72, 0x1D, 0x04,
|
|
+- 0x4F, 0x44, 0x96, 0xBC, 0xCA, 0x7E, 0xF4, 0x14, 0x6F, 0xBF, 0x25, 0xC9,
|
|
+- /* x */
|
|
+- 0xC0, 0xA0, 0x64, 0x7E, 0xAA, 0xB6, 0xA4, 0x87, 0x53, 0xB0, 0x33, 0xC5,
|
|
+- 0x6C, 0xB0, 0xF0, 0x90, 0x0A, 0x2F, 0x5C, 0x48, 0x53, 0x37, 0x5F, 0xD6,
|
|
+- /* y */
|
|
+- 0x14, 0xB6, 0x90, 0x86, 0x6A, 0xBD, 0x5B, 0xB8, 0x8B, 0x5F, 0x48, 0x28,
|
|
+- 0xC1, 0x49, 0x00, 0x02, 0xE6, 0x77, 0x3F, 0xA2, 0xFA, 0x29, 0x9B, 0x8F,
|
|
+- /* order */
|
|
+- 0xC3, 0x02, 0xF4, 0x1D, 0x93, 0x2A, 0x36, 0xCD, 0xA7, 0xA3, 0x46, 0x2F,
|
|
+- 0x9E, 0x9E, 0x91, 0x6B, 0x5B, 0xE8, 0xF1, 0x02, 0x9A, 0xC4, 0xAC, 0xC1
|
|
+- }
|
|
+-};
|
|
+-
|
|
+-static const struct {
|
|
+- EC_CURVE_DATA h;
|
|
+- unsigned char data[0 + 24 * 6];
|
|
+-} _EC_brainpoolP192t1 = {
|
|
+- {
|
|
+- NID_X9_62_prime_field, 0, 24, 1
|
|
+- },
|
|
+- {
|
|
+- /* no seed */
|
|
+- /* p */
|
|
+- 0xC3, 0x02, 0xF4, 0x1D, 0x93, 0x2A, 0x36, 0xCD, 0xA7, 0xA3, 0x46, 0x30,
|
|
+- 0x93, 0xD1, 0x8D, 0xB7, 0x8F, 0xCE, 0x47, 0x6D, 0xE1, 0xA8, 0x62, 0x97,
|
|
+- /* a */
|
|
+- 0xC3, 0x02, 0xF4, 0x1D, 0x93, 0x2A, 0x36, 0xCD, 0xA7, 0xA3, 0x46, 0x30,
|
|
+- 0x93, 0xD1, 0x8D, 0xB7, 0x8F, 0xCE, 0x47, 0x6D, 0xE1, 0xA8, 0x62, 0x94,
|
|
+- /* b */
|
|
+- 0x13, 0xD5, 0x6F, 0xFA, 0xEC, 0x78, 0x68, 0x1E, 0x68, 0xF9, 0xDE, 0xB4,
|
|
+- 0x3B, 0x35, 0xBE, 0xC2, 0xFB, 0x68, 0x54, 0x2E, 0x27, 0x89, 0x7B, 0x79,
|
|
+- /* x */
|
|
+- 0x3A, 0xE9, 0xE5, 0x8C, 0x82, 0xF6, 0x3C, 0x30, 0x28, 0x2E, 0x1F, 0xE7,
|
|
+- 0xBB, 0xF4, 0x3F, 0xA7, 0x2C, 0x44, 0x6A, 0xF6, 0xF4, 0x61, 0x81, 0x29,
|
|
+- /* y */
|
|
+- 0x09, 0x7E, 0x2C, 0x56, 0x67, 0xC2, 0x22, 0x3A, 0x90, 0x2A, 0xB5, 0xCA,
|
|
+- 0x44, 0x9D, 0x00, 0x84, 0xB7, 0xE5, 0xB3, 0xDE, 0x7C, 0xCC, 0x01, 0xC9,
|
|
+- /* order */
|
|
+- 0xC3, 0x02, 0xF4, 0x1D, 0x93, 0x2A, 0x36, 0xCD, 0xA7, 0xA3, 0x46, 0x2F,
|
|
+- 0x9E, 0x9E, 0x91, 0x6B, 0x5B, 0xE8, 0xF1, 0x02, 0x9A, 0xC4, 0xAC, 0xC1
|
|
+- }
|
|
+-};
|
|
+-
|
|
+-static const struct {
|
|
+- EC_CURVE_DATA h;
|
|
+- unsigned char data[0 + 28 * 6];
|
|
+-} _EC_brainpoolP224r1 = {
|
|
+- {
|
|
+- NID_X9_62_prime_field, 0, 28, 1
|
|
+- },
|
|
+- {
|
|
+- /* no seed */
|
|
+- /* p */
|
|
+- 0xD7, 0xC1, 0x34, 0xAA, 0x26, 0x43, 0x66, 0x86, 0x2A, 0x18, 0x30, 0x25,
|
|
+- 0x75, 0xD1, 0xD7, 0x87, 0xB0, 0x9F, 0x07, 0x57, 0x97, 0xDA, 0x89, 0xF5,
|
|
+- 0x7E, 0xC8, 0xC0, 0xFF,
|
|
+- /* a */
|
|
+- 0x68, 0xA5, 0xE6, 0x2C, 0xA9, 0xCE, 0x6C, 0x1C, 0x29, 0x98, 0x03, 0xA6,
|
|
+- 0xC1, 0x53, 0x0B, 0x51, 0x4E, 0x18, 0x2A, 0xD8, 0xB0, 0x04, 0x2A, 0x59,
|
|
+- 0xCA, 0xD2, 0x9F, 0x43,
|
|
+- /* b */
|
|
+- 0x25, 0x80, 0xF6, 0x3C, 0xCF, 0xE4, 0x41, 0x38, 0x87, 0x07, 0x13, 0xB1,
|
|
+- 0xA9, 0x23, 0x69, 0xE3, 0x3E, 0x21, 0x35, 0xD2, 0x66, 0xDB, 0xB3, 0x72,
|
|
+- 0x38, 0x6C, 0x40, 0x0B,
|
|
+- /* x */
|
|
+- 0x0D, 0x90, 0x29, 0xAD, 0x2C, 0x7E, 0x5C, 0xF4, 0x34, 0x08, 0x23, 0xB2,
|
|
+- 0xA8, 0x7D, 0xC6, 0x8C, 0x9E, 0x4C, 0xE3, 0x17, 0x4C, 0x1E, 0x6E, 0xFD,
|
|
+- 0xEE, 0x12, 0xC0, 0x7D,
|
|
+- /* y */
|
|
+- 0x58, 0xAA, 0x56, 0xF7, 0x72, 0xC0, 0x72, 0x6F, 0x24, 0xC6, 0xB8, 0x9E,
|
|
+- 0x4E, 0xCD, 0xAC, 0x24, 0x35, 0x4B, 0x9E, 0x99, 0xCA, 0xA3, 0xF6, 0xD3,
|
|
+- 0x76, 0x14, 0x02, 0xCD,
|
|
+- /* order */
|
|
+- 0xD7, 0xC1, 0x34, 0xAA, 0x26, 0x43, 0x66, 0x86, 0x2A, 0x18, 0x30, 0x25,
|
|
+- 0x75, 0xD0, 0xFB, 0x98, 0xD1, 0x16, 0xBC, 0x4B, 0x6D, 0xDE, 0xBC, 0xA3,
|
|
+- 0xA5, 0xA7, 0x93, 0x9F
|
|
+- }
|
|
+-};
|
|
+-
|
|
+-static const struct {
|
|
+- EC_CURVE_DATA h;
|
|
+- unsigned char data[0 + 28 * 6];
|
|
+-} _EC_brainpoolP224t1 = {
|
|
+- {
|
|
+- NID_X9_62_prime_field, 0, 28, 1
|
|
+- },
|
|
+- {
|
|
+- /* no seed */
|
|
+- /* p */
|
|
+- 0xD7, 0xC1, 0x34, 0xAA, 0x26, 0x43, 0x66, 0x86, 0x2A, 0x18, 0x30, 0x25,
|
|
+- 0x75, 0xD1, 0xD7, 0x87, 0xB0, 0x9F, 0x07, 0x57, 0x97, 0xDA, 0x89, 0xF5,
|
|
+- 0x7E, 0xC8, 0xC0, 0xFF,
|
|
+- /* a */
|
|
+- 0xD7, 0xC1, 0x34, 0xAA, 0x26, 0x43, 0x66, 0x86, 0x2A, 0x18, 0x30, 0x25,
|
|
+- 0x75, 0xD1, 0xD7, 0x87, 0xB0, 0x9F, 0x07, 0x57, 0x97, 0xDA, 0x89, 0xF5,
|
|
+- 0x7E, 0xC8, 0xC0, 0xFC,
|
|
+- /* b */
|
|
+- 0x4B, 0x33, 0x7D, 0x93, 0x41, 0x04, 0xCD, 0x7B, 0xEF, 0x27, 0x1B, 0xF6,
|
|
+- 0x0C, 0xED, 0x1E, 0xD2, 0x0D, 0xA1, 0x4C, 0x08, 0xB3, 0xBB, 0x64, 0xF1,
|
|
+- 0x8A, 0x60, 0x88, 0x8D,
|
|
+- /* x */
|
|
+- 0x6A, 0xB1, 0xE3, 0x44, 0xCE, 0x25, 0xFF, 0x38, 0x96, 0x42, 0x4E, 0x7F,
|
|
+- 0xFE, 0x14, 0x76, 0x2E, 0xCB, 0x49, 0xF8, 0x92, 0x8A, 0xC0, 0xC7, 0x60,
|
|
+- 0x29, 0xB4, 0xD5, 0x80,
|
|
+- /* y */
|
|
+- 0x03, 0x74, 0xE9, 0xF5, 0x14, 0x3E, 0x56, 0x8C, 0xD2, 0x3F, 0x3F, 0x4D,
|
|
+- 0x7C, 0x0D, 0x4B, 0x1E, 0x41, 0xC8, 0xCC, 0x0D, 0x1C, 0x6A, 0xBD, 0x5F,
|
|
+- 0x1A, 0x46, 0xDB, 0x4C,
|
|
+- /* order */
|
|
+- 0xD7, 0xC1, 0x34, 0xAA, 0x26, 0x43, 0x66, 0x86, 0x2A, 0x18, 0x30, 0x25,
|
|
+- 0x75, 0xD0, 0xFB, 0x98, 0xD1, 0x16, 0xBC, 0x4B, 0x6D, 0xDE, 0xBC, 0xA3,
|
|
+- 0xA5, 0xA7, 0x93, 0x9F
|
|
+- }
|
|
+-};
|
|
+-
|
|
+-static const struct {
|
|
+- EC_CURVE_DATA h;
|
|
+ unsigned char data[0 + 32 * 6];
|
|
+ } _EC_brainpoolP256r1 = {
|
|
+ {
|
|
+@@ -2854,8 +2065,6 @@ static const ec_list_element curve_list[
|
|
+ "NIST/SECG curve over a 521 bit prime field"},
|
|
+
|
|
+ /* X9.62 curves */
|
|
+- {NID_X9_62_prime192v1, &_EC_NIST_PRIME_192.h, 0,
|
|
+- "NIST/X9.62/SECG curve over a 192 bit prime field"},
|
|
+ {NID_X9_62_prime256v1, &_EC_X9_62_PRIME_256V1.h,
|
|
+ # if defined(ECP_NISTZ256_ASM)
|
|
+ EC_GFp_nistz256_method,
|
|
+@@ -2899,25 +2108,6 @@ static const ec_list_element curve_list[
|
|
+ static const ec_list_element curve_list[] = {
|
|
+ /* prime field curves */
|
|
+ /* secg curves */
|
|
+- {NID_secp112r1, &_EC_SECG_PRIME_112R1.h, 0,
|
|
+- "SECG/WTLS curve over a 112 bit prime field"},
|
|
+- {NID_secp112r2, &_EC_SECG_PRIME_112R2.h, 0,
|
|
+- "SECG curve over a 112 bit prime field"},
|
|
+- {NID_secp128r1, &_EC_SECG_PRIME_128R1.h, 0,
|
|
+- "SECG curve over a 128 bit prime field"},
|
|
+- {NID_secp128r2, &_EC_SECG_PRIME_128R2.h, 0,
|
|
+- "SECG curve over a 128 bit prime field"},
|
|
+- {NID_secp160k1, &_EC_SECG_PRIME_160K1.h, 0,
|
|
+- "SECG curve over a 160 bit prime field"},
|
|
+- {NID_secp160r1, &_EC_SECG_PRIME_160R1.h, 0,
|
|
+- "SECG curve over a 160 bit prime field"},
|
|
+- {NID_secp160r2, &_EC_SECG_PRIME_160R2.h, 0,
|
|
+- "SECG/WTLS curve over a 160 bit prime field"},
|
|
+- /* SECG secp192r1 is the same as X9.62 prime192v1 and hence omitted */
|
|
+- {NID_secp192k1, &_EC_SECG_PRIME_192K1.h, 0,
|
|
+- "SECG curve over a 192 bit prime field"},
|
|
+- {NID_secp224k1, &_EC_SECG_PRIME_224K1.h, 0,
|
|
+- "SECG curve over a 224 bit prime field"},
|
|
+ # ifndef OPENSSL_NO_EC_NISTP_64_GCC_128
|
|
+ {NID_secp224r1, &_EC_NIST_PRIME_224.h, EC_GFp_nistp224_method,
|
|
+ "NIST/SECG curve over a 224 bit prime field"},
|
|
+@@ -2945,18 +2135,6 @@ static const ec_list_element curve_list[
|
|
+ # endif
|
|
+ "NIST/SECG curve over a 521 bit prime field"},
|
|
+ /* X9.62 curves */
|
|
+- {NID_X9_62_prime192v1, &_EC_NIST_PRIME_192.h, 0,
|
|
+- "NIST/X9.62/SECG curve over a 192 bit prime field"},
|
|
+- {NID_X9_62_prime192v2, &_EC_X9_62_PRIME_192V2.h, 0,
|
|
+- "X9.62 curve over a 192 bit prime field"},
|
|
+- {NID_X9_62_prime192v3, &_EC_X9_62_PRIME_192V3.h, 0,
|
|
+- "X9.62 curve over a 192 bit prime field"},
|
|
+- {NID_X9_62_prime239v1, &_EC_X9_62_PRIME_239V1.h, 0,
|
|
+- "X9.62 curve over a 239 bit prime field"},
|
|
+- {NID_X9_62_prime239v2, &_EC_X9_62_PRIME_239V2.h, 0,
|
|
+- "X9.62 curve over a 239 bit prime field"},
|
|
+- {NID_X9_62_prime239v3, &_EC_X9_62_PRIME_239V3.h, 0,
|
|
+- "X9.62 curve over a 239 bit prime field"},
|
|
+ {NID_X9_62_prime256v1, &_EC_X9_62_PRIME_256V1.h,
|
|
+ # if defined(ECP_NISTZ256_ASM)
|
|
+ EC_GFp_nistz256_method,
|
|
+@@ -3053,22 +2231,12 @@ static const ec_list_element curve_list[
|
|
+ {NID_wap_wsg_idm_ecid_wtls5, &_EC_X9_62_CHAR2_163V1.h, 0,
|
|
+ "X9.62 curve over a 163 bit binary field"},
|
|
+ # endif
|
|
+- {NID_wap_wsg_idm_ecid_wtls6, &_EC_SECG_PRIME_112R1.h, 0,
|
|
+- "SECG/WTLS curve over a 112 bit prime field"},
|
|
+- {NID_wap_wsg_idm_ecid_wtls7, &_EC_SECG_PRIME_160R2.h, 0,
|
|
+- "SECG/WTLS curve over a 160 bit prime field"},
|
|
+- {NID_wap_wsg_idm_ecid_wtls8, &_EC_WTLS_8.h, 0,
|
|
+- "WTLS curve over a 112 bit prime field"},
|
|
+- {NID_wap_wsg_idm_ecid_wtls9, &_EC_WTLS_9.h, 0,
|
|
+- "WTLS curve over a 160 bit prime field"},
|
|
+ # ifndef OPENSSL_NO_EC2M
|
|
+ {NID_wap_wsg_idm_ecid_wtls10, &_EC_NIST_CHAR2_233K.h, 0,
|
|
+ "NIST/SECG/WTLS curve over a 233 bit binary field"},
|
|
+ {NID_wap_wsg_idm_ecid_wtls11, &_EC_NIST_CHAR2_233B.h, 0,
|
|
+ "NIST/SECG/WTLS curve over a 233 bit binary field"},
|
|
+ # endif
|
|
+- {NID_wap_wsg_idm_ecid_wtls12, &_EC_WTLS_12.h, 0,
|
|
+- "WTLS curve over a 224 bit prime field"},
|
|
+ # ifndef OPENSSL_NO_EC2M
|
|
+ /* IPSec curves */
|
|
+ {NID_ipsec3, &_EC_IPSEC_155_ID3.h, 0,
|
|
+@@ -3079,18 +2247,6 @@ static const ec_list_element curve_list[
|
|
+ "\tNot suitable for ECDSA.\n\tQuestionable extension field!"},
|
|
+ # endif
|
|
+ /* brainpool curves */
|
|
+- {NID_brainpoolP160r1, &_EC_brainpoolP160r1.h, 0,
|
|
+- "RFC 5639 curve over a 160 bit prime field"},
|
|
+- {NID_brainpoolP160t1, &_EC_brainpoolP160t1.h, 0,
|
|
+- "RFC 5639 curve over a 160 bit prime field"},
|
|
+- {NID_brainpoolP192r1, &_EC_brainpoolP192r1.h, 0,
|
|
+- "RFC 5639 curve over a 192 bit prime field"},
|
|
+- {NID_brainpoolP192t1, &_EC_brainpoolP192t1.h, 0,
|
|
+- "RFC 5639 curve over a 192 bit prime field"},
|
|
+- {NID_brainpoolP224r1, &_EC_brainpoolP224r1.h, 0,
|
|
+- "RFC 5639 curve over a 224 bit prime field"},
|
|
+- {NID_brainpoolP224t1, &_EC_brainpoolP224t1.h, 0,
|
|
+- "RFC 5639 curve over a 224 bit prime field"},
|
|
+ {NID_brainpoolP256r1, &_EC_brainpoolP256r1.h, 0,
|
|
+ "RFC 5639 curve over a 256 bit prime field"},
|
|
+ {NID_brainpoolP256t1, &_EC_brainpoolP256t1.h, 0,
|
|
+diff -up ./test/ectest.c.remove-ec ./test/ectest.c
|
|
+--- ./test/ectest.c.remove-ec 2023-03-13 18:39:30.544642912 +0100
|
|
++++ ./test/ectest.c 2023-03-20 07:27:26.403212965 +0100
|
|
+@@ -175,184 +175,26 @@ static int prime_field_tests(void)
|
|
+ || !TEST_ptr(p = BN_new())
|
|
+ || !TEST_ptr(a = BN_new())
|
|
+ || !TEST_ptr(b = BN_new())
|
|
+- || !TEST_true(BN_hex2bn(&p, "17"))
|
|
+- || !TEST_true(BN_hex2bn(&a, "1"))
|
|
+- || !TEST_true(BN_hex2bn(&b, "1"))
|
|
+- || !TEST_ptr(group = EC_GROUP_new_curve_GFp(p, a, b, ctx))
|
|
+- || !TEST_true(EC_GROUP_get_curve(group, p, a, b, ctx)))
|
|
++ /*
|
|
++ * applications should use EC_GROUP_new_curve_GFp so
|
|
++ * that the library gets to choose the EC_METHOD
|
|
++ */
|
|
++ || !TEST_ptr(group = EC_GROUP_new(EC_GFp_mont_method())))
|
|
+ goto err;
|
|
+
|
|
+- TEST_info("Curve defined by Weierstrass equation");
|
|
+- TEST_note(" y^2 = x^3 + a*x + b (mod p)");
|
|
+- test_output_bignum("a", a);
|
|
+- test_output_bignum("b", b);
|
|
+- test_output_bignum("p", p);
|
|
+-
|
|
+ buf[0] = 0;
|
|
+ if (!TEST_ptr(P = EC_POINT_new(group))
|
|
+ || !TEST_ptr(Q = EC_POINT_new(group))
|
|
+ || !TEST_ptr(R = EC_POINT_new(group))
|
|
+- || !TEST_true(EC_POINT_set_to_infinity(group, P))
|
|
+- || !TEST_true(EC_POINT_is_at_infinity(group, P))
|
|
+- || !TEST_true(EC_POINT_oct2point(group, Q, buf, 1, ctx))
|
|
+- || !TEST_true(EC_POINT_add(group, P, P, Q, ctx))
|
|
+- || !TEST_true(EC_POINT_is_at_infinity(group, P))
|
|
+ || !TEST_ptr(x = BN_new())
|
|
+ || !TEST_ptr(y = BN_new())
|
|
+ || !TEST_ptr(z = BN_new())
|
|
+- || !TEST_ptr(yplusone = BN_new())
|
|
+- || !TEST_true(BN_hex2bn(&x, "D"))
|
|
+- || !TEST_true(EC_POINT_set_compressed_coordinates(group, Q, x, 1, ctx)))
|
|
+- goto err;
|
|
+-
|
|
+- if (!TEST_int_gt(EC_POINT_is_on_curve(group, Q, ctx), 0)) {
|
|
+- if (!TEST_true(EC_POINT_get_affine_coordinates(group, Q, x, y, ctx)))
|
|
+- goto err;
|
|
+- TEST_info("Point is not on curve");
|
|
+- test_output_bignum("x", x);
|
|
+- test_output_bignum("y", y);
|
|
+- goto err;
|
|
+- }
|
|
+-
|
|
+- TEST_note("A cyclic subgroup:");
|
|
+- k = 100;
|
|
+- do {
|
|
+- if (!TEST_int_ne(k--, 0))
|
|
+- goto err;
|
|
+-
|
|
+- if (EC_POINT_is_at_infinity(group, P)) {
|
|
+- TEST_note(" point at infinity");
|
|
+- } else {
|
|
+- if (!TEST_true(EC_POINT_get_affine_coordinates(group, P, x, y,
|
|
+- ctx)))
|
|
+- goto err;
|
|
+-
|
|
+- test_output_bignum("x", x);
|
|
+- test_output_bignum("y", y);
|
|
+- }
|
|
+-
|
|
+- if (!TEST_true(EC_POINT_copy(R, P))
|
|
+- || !TEST_true(EC_POINT_add(group, P, P, Q, ctx)))
|
|
+- goto err;
|
|
+-
|
|
+- } while (!EC_POINT_is_at_infinity(group, P));
|
|
+-
|
|
+- if (!TEST_true(EC_POINT_add(group, P, Q, R, ctx))
|
|
+- || !TEST_true(EC_POINT_is_at_infinity(group, P)))
|
|
+- goto err;
|
|
+-
|
|
+- len =
|
|
+- EC_POINT_point2oct(group, Q, POINT_CONVERSION_COMPRESSED, buf,
|
|
+- sizeof(buf), ctx);
|
|
+- if (!TEST_size_t_ne(len, 0)
|
|
+- || !TEST_true(EC_POINT_oct2point(group, P, buf, len, ctx))
|
|
+- || !TEST_int_eq(0, EC_POINT_cmp(group, P, Q, ctx)))
|
|
+- goto err;
|
|
+- test_output_memory("Generator as octet string, compressed form:",
|
|
+- buf, len);
|
|
+-
|
|
+- len = EC_POINT_point2oct(group, Q, POINT_CONVERSION_UNCOMPRESSED,
|
|
+- buf, sizeof(buf), ctx);
|
|
+- if (!TEST_size_t_ne(len, 0)
|
|
+- || !TEST_true(EC_POINT_oct2point(group, P, buf, len, ctx))
|
|
+- || !TEST_int_eq(0, EC_POINT_cmp(group, P, Q, ctx)))
|
|
+- goto err;
|
|
+- test_output_memory("Generator as octet string, uncompressed form:",
|
|
+- buf, len);
|
|
+-
|
|
+- len = EC_POINT_point2oct(group, Q, POINT_CONVERSION_HYBRID,
|
|
+- buf, sizeof(buf), ctx);
|
|
+- if (!TEST_size_t_ne(len, 0)
|
|
+- || !TEST_true(EC_POINT_oct2point(group, P, buf, len, ctx))
|
|
+- || !TEST_int_eq(0, EC_POINT_cmp(group, P, Q, ctx)))
|
|
+- goto err;
|
|
+- test_output_memory("Generator as octet string, hybrid form:",
|
|
+- buf, len);
|
|
+-
|
|
+- if (!TEST_true(EC_POINT_invert(group, P, ctx))
|
|
+- || !TEST_int_eq(0, EC_POINT_cmp(group, P, R, ctx))
|
|
+-
|
|
+- /*
|
|
+- * Curve secp160r1 (Certicom Research SEC 2 Version 1.0, section 2.4.2,
|
|
+- * 2000) -- not a NIST curve, but commonly used
|
|
+- */
|
|
+-
|
|
+- || !TEST_true(BN_hex2bn(&p, "FFFFFFFF"
|
|
+- "FFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF"))
|
|
+- || !TEST_int_eq(1, BN_check_prime(p, ctx, NULL))
|
|
+- || !TEST_true(BN_hex2bn(&a, "FFFFFFFF"
|
|
+- "FFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC"))
|
|
+- || !TEST_true(BN_hex2bn(&b, "1C97BEFC"
|
|
+- "54BD7A8B65ACF89F81D4D4ADC565FA45"))
|
|
+- || !TEST_true(EC_GROUP_set_curve(group, p, a, b, ctx))
|
|
+- || !TEST_true(BN_hex2bn(&x, "4A96B568"
|
|
+- "8EF573284664698968C38BB913CBFC82"))
|
|
+- || !TEST_true(BN_hex2bn(&y, "23a62855"
|
|
+- "3168947d59dcc912042351377ac5fb32"))
|
|
+- || !TEST_true(BN_add(yplusone, y, BN_value_one()))
|
|
+- /*
|
|
+- * When (x, y) is on the curve, (x, y + 1) is, as it happens, not,
|
|
+- * and therefore setting the coordinates should fail.
|
|
+- */
|
|
+- || !TEST_false(EC_POINT_set_affine_coordinates(group, P, x, yplusone,
|
|
+- ctx))
|
|
+- || !TEST_true(EC_POINT_set_affine_coordinates(group, P, x, y, ctx))
|
|
+- || !TEST_int_gt(EC_POINT_is_on_curve(group, P, ctx), 0)
|
|
+- || !TEST_true(BN_hex2bn(&z, "0100000000"
|
|
+- "000000000001F4C8F927AED3CA752257"))
|
|
+- || !TEST_true(EC_GROUP_set_generator(group, P, z, BN_value_one()))
|
|
+- || !TEST_true(EC_POINT_get_affine_coordinates(group, P, x, y, ctx)))
|
|
+- goto err;
|
|
+- TEST_info("SEC2 curve secp160r1 -- Generator");
|
|
+- test_output_bignum("x", x);
|
|
+- test_output_bignum("y", y);
|
|
+- /* G_y value taken from the standard: */
|
|
+- if (!TEST_true(BN_hex2bn(&z, "23a62855"
|
|
+- "3168947d59dcc912042351377ac5fb32"))
|
|
+- || !TEST_BN_eq(y, z)
|
|
+- || !TEST_int_eq(EC_GROUP_get_degree(group), 160)
|
|
+- || !group_order_tests(group)
|
|
+-
|
|
+- /* Curve P-192 (FIPS PUB 186-2, App. 6) */
|
|
+-
|
|
+- || !TEST_true(BN_hex2bn(&p, "FFFFFFFFFFFFFFFF"
|
|
+- "FFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF"))
|
|
+- || !TEST_int_eq(1, BN_check_prime(p, ctx, NULL))
|
|
+- || !TEST_true(BN_hex2bn(&a, "FFFFFFFFFFFFFFFF"
|
|
+- "FFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC"))
|
|
+- || !TEST_true(BN_hex2bn(&b, "64210519E59C80E7"
|
|
+- "0FA7E9AB72243049FEB8DEECC146B9B1"))
|
|
+- || !TEST_true(EC_GROUP_set_curve(group, p, a, b, ctx))
|
|
+- || !TEST_true(BN_hex2bn(&x, "188DA80EB03090F6"
|
|
+- "7CBF20EB43A18800F4FF0AFD82FF1012"))
|
|
+- || !TEST_true(EC_POINT_set_compressed_coordinates(group, P, x, 1, ctx))
|
|
+- || !TEST_int_gt(EC_POINT_is_on_curve(group, P, ctx), 0)
|
|
+- || !TEST_true(BN_hex2bn(&z, "FFFFFFFFFFFFFFFF"
|
|
+- "FFFFFFFF99DEF836146BC9B1B4D22831"))
|
|
+- || !TEST_true(EC_GROUP_set_generator(group, P, z, BN_value_one()))
|
|
+- || !TEST_true(EC_POINT_get_affine_coordinates(group, P, x, y, ctx)))
|
|
++ || !TEST_ptr(yplusone = BN_new()))
|
|
+ goto err;
|
|
+
|
|
+- TEST_info("NIST curve P-192 -- Generator");
|
|
+- test_output_bignum("x", x);
|
|
+- test_output_bignum("y", y);
|
|
+- /* G_y value taken from the standard: */
|
|
+- if (!TEST_true(BN_hex2bn(&z, "07192B95FFC8DA78"
|
|
+- "631011ED6B24CDD573F977A11E794811"))
|
|
+- || !TEST_BN_eq(y, z)
|
|
+- || !TEST_true(BN_add(yplusone, y, BN_value_one()))
|
|
+- /*
|
|
+- * When (x, y) is on the curve, (x, y + 1) is, as it happens, not,
|
|
+- * and therefore setting the coordinates should fail.
|
|
+- */
|
|
+- || !TEST_false(EC_POINT_set_affine_coordinates(group, P, x, yplusone,
|
|
+- ctx))
|
|
+- || !TEST_int_eq(EC_GROUP_get_degree(group), 192)
|
|
+- || !group_order_tests(group)
|
|
+-
|
|
+ /* Curve P-224 (FIPS PUB 186-2, App. 6) */
|
|
+
|
|
+- || !TEST_true(BN_hex2bn(&p, "FFFFFFFFFFFFFFFFFFFFFFFF"
|
|
++ if (!TEST_true(BN_hex2bn(&p, "FFFFFFFFFFFFFFFFFFFFFFFF"
|
|
+ "FFFFFFFF000000000000000000000001"))
|
|
+ || !TEST_int_eq(1, BN_check_prime(p, ctx, NULL))
|
|
+ || !TEST_true(BN_hex2bn(&a, "FFFFFFFFFFFFFFFFFFFFFFFF"
|
|
+@@ -3015,7 +2857,7 @@ int setup_tests(void)
|
|
+ return 0;
|
|
+
|
|
+ ADD_TEST(parameter_test);
|
|
+- ADD_TEST(cofactor_range_test);
|
|
++ /* ADD_TEST(cofactor_range_test); */
|
|
+ ADD_ALL_TESTS(cardinality_test, crv_len);
|
|
+ ADD_TEST(prime_field_tests);
|
|
+ #ifndef OPENSSL_NO_EC2M
|
|
diff --git a/openssl_source/0011-Remove-EC-curves.patch b/openssl_source/0011-Remove-EC-curves.patch
|
|
new file mode 100644
|
|
index 0000000..f6c733a
|
|
--- /dev/null
|
|
+++ b/openssl_source/0011-Remove-EC-curves.patch
|
|
@@ -0,0 +1,236 @@
|
|
+diff -up ./apps/speed.c.ec-curves ./apps/speed.c
|
|
+--- ./apps/speed.c.ec-curves 2023-03-14 04:44:12.545437892 +0100
|
|
++++ ./apps/speed.c 2023-03-14 04:48:28.606729067 +0100
|
|
+@@ -366,7 +366,7 @@ static double ffdh_results[FFDH_NUM][1];
|
|
+ #endif /* OPENSSL_NO_DH */
|
|
+
|
|
+ enum ec_curves_t {
|
|
+- R_EC_P160, R_EC_P192, R_EC_P224, R_EC_P256, R_EC_P384, R_EC_P521,
|
|
++ R_EC_P224, R_EC_P256, R_EC_P384, R_EC_P521,
|
|
+ #ifndef OPENSSL_NO_EC2M
|
|
+ R_EC_K163, R_EC_K233, R_EC_K283, R_EC_K409, R_EC_K571,
|
|
+ R_EC_B163, R_EC_B233, R_EC_B283, R_EC_B409, R_EC_B571,
|
|
+@@ -376,8 +376,6 @@ enum ec_curves_t {
|
|
+ };
|
|
+ /* list of ecdsa curves */
|
|
+ static const OPT_PAIR ecdsa_choices[ECDSA_NUM] = {
|
|
+- {"ecdsap160", R_EC_P160},
|
|
+- {"ecdsap192", R_EC_P192},
|
|
+ {"ecdsap224", R_EC_P224},
|
|
+ {"ecdsap256", R_EC_P256},
|
|
+ {"ecdsap384", R_EC_P384},
|
|
+@@ -404,8 +402,6 @@ static const OPT_PAIR ecdsa_choices[ECDS
|
|
+ enum { R_EC_X25519 = ECDSA_NUM, R_EC_X448, EC_NUM };
|
|
+ /* list of ecdh curves, extension of |ecdsa_choices| list above */
|
|
+ static const OPT_PAIR ecdh_choices[EC_NUM] = {
|
|
+- {"ecdhp160", R_EC_P160},
|
|
+- {"ecdhp192", R_EC_P192},
|
|
+ {"ecdhp224", R_EC_P224},
|
|
+ {"ecdhp256", R_EC_P256},
|
|
+ {"ecdhp384", R_EC_P384},
|
|
+@@ -1422,8 +1418,6 @@ int speed_main(int argc, char **argv)
|
|
+ */
|
|
+ static const EC_CURVE ec_curves[EC_NUM] = {
|
|
+ /* Prime Curves */
|
|
+- {"secp160r1", NID_secp160r1, 160},
|
|
+- {"nistp192", NID_X9_62_prime192v1, 192},
|
|
+ {"nistp224", NID_secp224r1, 224},
|
|
+ {"nistp256", NID_X9_62_prime256v1, 256},
|
|
+ {"nistp384", NID_secp384r1, 384},
|
|
+diff -up ./crypto/evp/ec_support.c.ec-curves ./crypto/evp/ec_support.c
|
|
+--- ./crypto/evp/ec_support.c.ec-curves 2023-03-14 06:22:41.542310442 +0100
|
|
++++ ./crypto/evp/ec_support.c 2023-03-21 11:24:18.378451683 +0100
|
|
+@@ -20,89 +20,15 @@ typedef struct ec_name2nid_st {
|
|
+ static const EC_NAME2NID curve_list[] = {
|
|
+ /* prime field curves */
|
|
+ /* secg curves */
|
|
+- {"secp112r1", NID_secp112r1 },
|
|
+- {"secp112r2", NID_secp112r2 },
|
|
+- {"secp128r1", NID_secp128r1 },
|
|
+- {"secp128r2", NID_secp128r2 },
|
|
+- {"secp160k1", NID_secp160k1 },
|
|
+- {"secp160r1", NID_secp160r1 },
|
|
+- {"secp160r2", NID_secp160r2 },
|
|
+- {"secp192k1", NID_secp192k1 },
|
|
+- {"secp224k1", NID_secp224k1 },
|
|
+ {"secp224r1", NID_secp224r1 },
|
|
+ {"secp256k1", NID_secp256k1 },
|
|
+ {"secp384r1", NID_secp384r1 },
|
|
+ {"secp521r1", NID_secp521r1 },
|
|
+ /* X9.62 curves */
|
|
+- {"prime192v1", NID_X9_62_prime192v1 },
|
|
+- {"prime192v2", NID_X9_62_prime192v2 },
|
|
+- {"prime192v3", NID_X9_62_prime192v3 },
|
|
+- {"prime239v1", NID_X9_62_prime239v1 },
|
|
+- {"prime239v2", NID_X9_62_prime239v2 },
|
|
+- {"prime239v3", NID_X9_62_prime239v3 },
|
|
+ {"prime256v1", NID_X9_62_prime256v1 },
|
|
+ /* characteristic two field curves */
|
|
+ /* NIST/SECG curves */
|
|
+- {"sect113r1", NID_sect113r1 },
|
|
+- {"sect113r2", NID_sect113r2 },
|
|
+- {"sect131r1", NID_sect131r1 },
|
|
+- {"sect131r2", NID_sect131r2 },
|
|
+- {"sect163k1", NID_sect163k1 },
|
|
+- {"sect163r1", NID_sect163r1 },
|
|
+- {"sect163r2", NID_sect163r2 },
|
|
+- {"sect193r1", NID_sect193r1 },
|
|
+- {"sect193r2", NID_sect193r2 },
|
|
+- {"sect233k1", NID_sect233k1 },
|
|
+- {"sect233r1", NID_sect233r1 },
|
|
+- {"sect239k1", NID_sect239k1 },
|
|
+- {"sect283k1", NID_sect283k1 },
|
|
+- {"sect283r1", NID_sect283r1 },
|
|
+- {"sect409k1", NID_sect409k1 },
|
|
+- {"sect409r1", NID_sect409r1 },
|
|
+- {"sect571k1", NID_sect571k1 },
|
|
+- {"sect571r1", NID_sect571r1 },
|
|
+- /* X9.62 curves */
|
|
+- {"c2pnb163v1", NID_X9_62_c2pnb163v1 },
|
|
+- {"c2pnb163v2", NID_X9_62_c2pnb163v2 },
|
|
+- {"c2pnb163v3", NID_X9_62_c2pnb163v3 },
|
|
+- {"c2pnb176v1", NID_X9_62_c2pnb176v1 },
|
|
+- {"c2tnb191v1", NID_X9_62_c2tnb191v1 },
|
|
+- {"c2tnb191v2", NID_X9_62_c2tnb191v2 },
|
|
+- {"c2tnb191v3", NID_X9_62_c2tnb191v3 },
|
|
+- {"c2pnb208w1", NID_X9_62_c2pnb208w1 },
|
|
+- {"c2tnb239v1", NID_X9_62_c2tnb239v1 },
|
|
+- {"c2tnb239v2", NID_X9_62_c2tnb239v2 },
|
|
+- {"c2tnb239v3", NID_X9_62_c2tnb239v3 },
|
|
+- {"c2pnb272w1", NID_X9_62_c2pnb272w1 },
|
|
+- {"c2pnb304w1", NID_X9_62_c2pnb304w1 },
|
|
+- {"c2tnb359v1", NID_X9_62_c2tnb359v1 },
|
|
+- {"c2pnb368w1", NID_X9_62_c2pnb368w1 },
|
|
+- {"c2tnb431r1", NID_X9_62_c2tnb431r1 },
|
|
+- /*
|
|
+- * the WAP/WTLS curves [unlike SECG, spec has its own OIDs for curves
|
|
+- * from X9.62]
|
|
+- */
|
|
+- {"wap-wsg-idm-ecid-wtls1", NID_wap_wsg_idm_ecid_wtls1 },
|
|
+- {"wap-wsg-idm-ecid-wtls3", NID_wap_wsg_idm_ecid_wtls3 },
|
|
+- {"wap-wsg-idm-ecid-wtls4", NID_wap_wsg_idm_ecid_wtls4 },
|
|
+- {"wap-wsg-idm-ecid-wtls5", NID_wap_wsg_idm_ecid_wtls5 },
|
|
+- {"wap-wsg-idm-ecid-wtls6", NID_wap_wsg_idm_ecid_wtls6 },
|
|
+- {"wap-wsg-idm-ecid-wtls7", NID_wap_wsg_idm_ecid_wtls7 },
|
|
+- {"wap-wsg-idm-ecid-wtls8", NID_wap_wsg_idm_ecid_wtls8 },
|
|
+- {"wap-wsg-idm-ecid-wtls9", NID_wap_wsg_idm_ecid_wtls9 },
|
|
+- {"wap-wsg-idm-ecid-wtls10", NID_wap_wsg_idm_ecid_wtls10 },
|
|
+- {"wap-wsg-idm-ecid-wtls11", NID_wap_wsg_idm_ecid_wtls11 },
|
|
+- {"wap-wsg-idm-ecid-wtls12", NID_wap_wsg_idm_ecid_wtls12 },
|
|
+- /* IPSec curves */
|
|
+- {"Oakley-EC2N-3", NID_ipsec3 },
|
|
+- {"Oakley-EC2N-4", NID_ipsec4 },
|
|
+ /* brainpool curves */
|
|
+- {"brainpoolP160r1", NID_brainpoolP160r1 },
|
|
+- {"brainpoolP160t1", NID_brainpoolP160t1 },
|
|
+- {"brainpoolP192r1", NID_brainpoolP192r1 },
|
|
+- {"brainpoolP192t1", NID_brainpoolP192t1 },
|
|
+- {"brainpoolP224r1", NID_brainpoolP224r1 },
|
|
+- {"brainpoolP224t1", NID_brainpoolP224t1 },
|
|
+ {"brainpoolP256r1", NID_brainpoolP256r1 },
|
|
+ {"brainpoolP256t1", NID_brainpoolP256t1 },
|
|
+ {"brainpoolP320r1", NID_brainpoolP320r1 },
|
|
+@@ -111,8 +37,6 @@ static const EC_NAME2NID curve_list[] =
|
|
+ {"brainpoolP384t1", NID_brainpoolP384t1 },
|
|
+ {"brainpoolP512r1", NID_brainpoolP512r1 },
|
|
+ {"brainpoolP512t1", NID_brainpoolP512t1 },
|
|
+- /* SM2 curve */
|
|
+- {"SM2", NID_sm2 },
|
|
+ };
|
|
+
|
|
+ const char *OSSL_EC_curve_nid2name(int nid)
|
|
+diff -up ./test/acvp_test.inc.ec-curves ./test/acvp_test.inc
|
|
+--- ./test/acvp_test.inc.ec-curves 2023-03-14 06:38:20.563712586 +0100
|
|
++++ ./test/acvp_test.inc 2023-03-14 06:39:01.631080059 +0100
|
|
+@@ -212,15 +212,6 @@ static const unsigned char ecdsa_sigver_
|
|
+ };
|
|
+ static const struct ecdsa_sigver_st ecdsa_sigver_data[] = {
|
|
+ {
|
|
+- "SHA-1",
|
|
+- "P-192",
|
|
+- ITM(ecdsa_sigver_msg0),
|
|
+- ITM(ecdsa_sigver_pub0),
|
|
+- ITM(ecdsa_sigver_r0),
|
|
+- ITM(ecdsa_sigver_s0),
|
|
+- PASS,
|
|
+- },
|
|
+- {
|
|
+ "SHA2-512",
|
|
+ "P-521",
|
|
+ ITM(ecdsa_sigver_msg1),
|
|
+diff -up ./test/ecdsatest.h.ec-curves ./test/ecdsatest.h
|
|
+--- ./test/ecdsatest.h.ec-curves 2023-03-14 04:49:16.148154472 +0100
|
|
++++ ./test/ecdsatest.h 2023-03-14 04:51:01.376096037 +0100
|
|
+@@ -32,23 +32,6 @@ typedef struct {
|
|
+ } ecdsa_cavs_kat_t;
|
|
+
|
|
+ static const ecdsa_cavs_kat_t ecdsa_cavs_kats[] = {
|
|
+- /* prime KATs from X9.62 */
|
|
+- {NID_X9_62_prime192v1, NID_sha1,
|
|
+- "616263", /* "abc" */
|
|
+- "1a8d598fc15bf0fd89030b5cb1111aeb92ae8baf5ea475fb",
|
|
+- "0462b12d60690cdcf330babab6e69763b471f994dd702d16a563bf5ec08069705ffff65e"
|
|
+- "5ca5c0d69716dfcb3474373902",
|
|
+- "fa6de29746bbeb7f8bb1e761f85f7dfb2983169d82fa2f4e",
|
|
+- "885052380ff147b734c330c43d39b2c4a89f29b0f749fead",
|
|
+- "e9ecc78106def82bf1070cf1d4d804c3cb390046951df686"},
|
|
+- {NID_X9_62_prime239v1, NID_sha1,
|
|
+- "616263", /* "abc" */
|
|
+- "7ef7c6fabefffdea864206e80b0b08a9331ed93e698561b64ca0f7777f3d",
|
|
+- "045b6dc53bc61a2548ffb0f671472de6c9521a9d2d2534e65abfcbd5fe0c707fd9f1ed2e"
|
|
+- "65f09f6ce0893baf5e8e31e6ae82ea8c3592335be906d38dee",
|
|
+- "656c7196bf87dcc5d1f1020906df2782360d36b2de7a17ece37d503784af",
|
|
+- "2cb7f36803ebb9c427c58d8265f11fc5084747133078fc279de874fbecb0",
|
|
+- "2eeae988104e9c2234a3c2beb1f53bfa5dc11ff36a875d1e3ccb1f7e45cf"},
|
|
+ /* prime KATs from NIST CAVP */
|
|
+ {NID_secp224r1, NID_sha224,
|
|
+ "699325d6fc8fbbb4981a6ded3c3a54ad2e4e3db8a5669201912064c64e700c139248cdc1"
|
|
+diff -up ./test/recipes/15-test_genec.t.ec-curves ./test/recipes/15-test_genec.t
|
|
+--- ./test/recipes/15-test_genec.t.ec-curves 2023-03-14 04:51:45.215488277 +0100
|
|
++++ ./test/recipes/15-test_genec.t 2023-03-21 11:26:58.613885435 +0100
|
|
+@@ -41,37 +41,11 @@ plan skip_all => "This test is unsupport
|
|
+ if disabled("ec");
|
|
+
|
|
+ my @prime_curves = qw(
|
|
+- secp112r1
|
|
+- secp112r2
|
|
+- secp128r1
|
|
+- secp128r2
|
|
+- secp160k1
|
|
+- secp160r1
|
|
+- secp160r2
|
|
+- secp192k1
|
|
+- secp224k1
|
|
+ secp224r1
|
|
+ secp256k1
|
|
+ secp384r1
|
|
+ secp521r1
|
|
+- prime192v1
|
|
+- prime192v2
|
|
+- prime192v3
|
|
+- prime239v1
|
|
+- prime239v2
|
|
+- prime239v3
|
|
+ prime256v1
|
|
+- wap-wsg-idm-ecid-wtls6
|
|
+- wap-wsg-idm-ecid-wtls7
|
|
+- wap-wsg-idm-ecid-wtls8
|
|
+- wap-wsg-idm-ecid-wtls9
|
|
+- wap-wsg-idm-ecid-wtls12
|
|
+- brainpoolP160r1
|
|
+- brainpoolP160t1
|
|
+- brainpoolP192r1
|
|
+- brainpoolP192t1
|
|
+- brainpoolP224r1
|
|
+- brainpoolP224t1
|
|
+ brainpoolP256r1
|
|
+ brainpoolP256t1
|
|
+ brainpoolP320r1
|
|
+@@ -136,7 +110,6 @@ push(@other_curves, 'SM2')
|
|
+ if !disabled("sm2");
|
|
+
|
|
+ my @curve_aliases = qw(
|
|
+- P-192
|
|
+ P-224
|
|
+ P-256
|
|
+ P-384
|
|
diff --git a/openssl_source/0012-Disable-explicit-ec.patch b/openssl_source/0012-Disable-explicit-ec.patch
|
|
new file mode 100644
|
|
index 0000000..0cae2fa
|
|
--- /dev/null
|
|
+++ b/openssl_source/0012-Disable-explicit-ec.patch
|
|
@@ -0,0 +1,208 @@
|
|
+diff -up openssl-3.0.1/crypto/ec/ec_asn1.c.disable_explicit_ec openssl-3.0.1/crypto/ec/ec_asn1.c
|
|
+--- openssl-3.0.1/crypto/ec/ec_asn1.c.disable_explicit_ec 2022-03-22 13:10:45.718077845 +0100
|
|
++++ openssl-3.0.1/crypto/ec/ec_asn1.c 2022-03-22 13:12:46.626599016 +0100
|
|
+@@ -895,6 +895,12 @@ EC_GROUP *d2i_ECPKParameters(EC_GROUP **
|
|
+ if (params->type == ECPKPARAMETERS_TYPE_EXPLICIT)
|
|
+ group->decoded_from_explicit_params = 1;
|
|
+
|
|
++ if (EC_GROUP_check_named_curve(group, 0, NULL) == NID_undef) {
|
|
++ EC_GROUP_free(group);
|
|
++ ECPKPARAMETERS_free(params);
|
|
++ return NULL;
|
|
++ }
|
|
++
|
|
+ if (a) {
|
|
+ EC_GROUP_free(*a);
|
|
+ *a = group;
|
|
+@@ -954,6 +959,11 @@ EC_KEY *d2i_ECPrivateKey(EC_KEY **a, con
|
|
+ goto err;
|
|
+ }
|
|
+
|
|
++ if (EC_GROUP_check_named_curve(ret->group, 0, NULL) == NID_undef) {
|
|
++ ERR_raise(ERR_LIB_EC, EC_R_UNKNOWN_GROUP);
|
|
++ goto err;
|
|
++ }
|
|
++
|
|
+ ret->version = priv_key->version;
|
|
+
|
|
+ if (priv_key->privateKey) {
|
|
+diff -up openssl-3.0.9/crypto/ec/ec_lib.c.noec openssl-3.0.9/crypto/ec/ec_lib.c
|
|
+--- openssl-3.0.9/crypto/ec/ec_lib.c.noec 2023-07-27 10:32:52.870910095 +0200
|
|
++++ openssl-3.0.9/crypto/ec/ec_lib.c 2023-07-27 10:35:18.029151181 +0200
|
|
+@@ -1728,6 +1728,11 @@ EC_GROUP *EC_GROUP_new_from_params(const
|
|
+ goto err;
|
|
+ }
|
|
+ if (named_group == group) {
|
|
++ if (EC_GROUP_check_named_curve(group, 0, NULL) == NID_undef) {
|
|
++ ERR_raise(ERR_LIB_EC, EC_R_UNKNOWN_GROUP);
|
|
++ goto err;
|
|
++ }
|
|
++#if 0
|
|
+ /*
|
|
+ * If we did not find a named group then the encoding should be explicit
|
|
+ * if it was specified
|
|
+@@ -1743,6 +1748,7 @@ EC_GROUP *EC_GROUP_new_from_params(const
|
|
+ goto err;
|
|
+ }
|
|
+ EC_GROUP_set_asn1_flag(group, OPENSSL_EC_EXPLICIT_CURVE);
|
|
++#endif
|
|
+ } else {
|
|
+ EC_GROUP_free(group);
|
|
+ group = named_group;
|
|
+diff -up openssl-3.0.1/test/endecode_test.c.disable_explicit_ec openssl-3.0.1/test/endecode_test.c
|
|
+--- openssl-3.0.1/test/endecode_test.c.disable_explicit_ec 2022-03-21 16:55:46.005558779 +0100
|
|
++++ openssl-3.0.1/test/endecode_test.c 2022-03-21 16:56:12.636792762 +0100
|
|
+@@ -57,7 +57,7 @@ static BN_CTX *bnctx = NULL;
|
|
+ static OSSL_PARAM_BLD *bld_prime_nc = NULL;
|
|
+ static OSSL_PARAM_BLD *bld_prime = NULL;
|
|
+ static OSSL_PARAM *ec_explicit_prime_params_nc = NULL;
|
|
+-static OSSL_PARAM *ec_explicit_prime_params_explicit = NULL;
|
|
++/*static OSSL_PARAM *ec_explicit_prime_params_explicit = NULL;*/
|
|
+
|
|
+ # ifndef OPENSSL_NO_EC2M
|
|
+ static OSSL_PARAM_BLD *bld_tri_nc = NULL;
|
|
+@@ -990,9 +990,9 @@ IMPLEMENT_TEST_SUITE_LEGACY(EC, "EC")
|
|
+ DOMAIN_KEYS(ECExplicitPrimeNamedCurve);
|
|
+ IMPLEMENT_TEST_SUITE(ECExplicitPrimeNamedCurve, "EC", 1)
|
|
+ IMPLEMENT_TEST_SUITE_LEGACY(ECExplicitPrimeNamedCurve, "EC")
|
|
+-DOMAIN_KEYS(ECExplicitPrime2G);
|
|
+-IMPLEMENT_TEST_SUITE(ECExplicitPrime2G, "EC", 0)
|
|
+-IMPLEMENT_TEST_SUITE_LEGACY(ECExplicitPrime2G, "EC")
|
|
++/*DOMAIN_KEYS(ECExplicitPrime2G);*/
|
|
++/*IMPLEMENT_TEST_SUITE(ECExplicitPrime2G, "EC", 0)*/
|
|
++/*IMPLEMENT_TEST_SUITE_LEGACY(ECExplicitPrime2G, "EC")*/
|
|
+ # ifndef OPENSSL_NO_EC2M
|
|
+ DOMAIN_KEYS(ECExplicitTriNamedCurve);
|
|
+ IMPLEMENT_TEST_SUITE(ECExplicitTriNamedCurve, "EC", 1)
|
|
+@@ -1318,7 +1318,7 @@ int setup_tests(void)
|
|
+ || !create_ec_explicit_prime_params_namedcurve(bld_prime_nc)
|
|
+ || !create_ec_explicit_prime_params(bld_prime)
|
|
+ || !TEST_ptr(ec_explicit_prime_params_nc = OSSL_PARAM_BLD_to_param(bld_prime_nc))
|
|
+- || !TEST_ptr(ec_explicit_prime_params_explicit = OSSL_PARAM_BLD_to_param(bld_prime))
|
|
++/* || !TEST_ptr(ec_explicit_prime_params_explicit = OSSL_PARAM_BLD_to_param(bld_prime))*/
|
|
+ # ifndef OPENSSL_NO_EC2M
|
|
+ || !TEST_ptr(bld_tri_nc = OSSL_PARAM_BLD_new())
|
|
+ || !TEST_ptr(bld_tri = OSSL_PARAM_BLD_new())
|
|
+@@ -1346,7 +1346,7 @@ int setup_tests(void)
|
|
+ TEST_info("Generating EC keys...");
|
|
+ MAKE_DOMAIN_KEYS(EC, "EC", EC_params);
|
|
+ MAKE_DOMAIN_KEYS(ECExplicitPrimeNamedCurve, "EC", ec_explicit_prime_params_nc);
|
|
+- MAKE_DOMAIN_KEYS(ECExplicitPrime2G, "EC", ec_explicit_prime_params_explicit);
|
|
++/* MAKE_DOMAIN_KEYS(ECExplicitPrime2G, "EC", ec_explicit_prime_params_explicit);*/
|
|
+ # ifndef OPENSSL_NO_EC2M
|
|
+ MAKE_DOMAIN_KEYS(ECExplicitTriNamedCurve, "EC", ec_explicit_tri_params_nc);
|
|
+ MAKE_DOMAIN_KEYS(ECExplicitTri2G, "EC", ec_explicit_tri_params_explicit);
|
|
+@@ -1389,8 +1389,8 @@ int setup_tests(void)
|
|
+ ADD_TEST_SUITE_LEGACY(EC);
|
|
+ ADD_TEST_SUITE(ECExplicitPrimeNamedCurve);
|
|
+ ADD_TEST_SUITE_LEGACY(ECExplicitPrimeNamedCurve);
|
|
+- ADD_TEST_SUITE(ECExplicitPrime2G);
|
|
+- ADD_TEST_SUITE_LEGACY(ECExplicitPrime2G);
|
|
++/* ADD_TEST_SUITE(ECExplicitPrime2G);*/
|
|
++/* ADD_TEST_SUITE_LEGACY(ECExplicitPrime2G);*/
|
|
+ # ifndef OPENSSL_NO_EC2M
|
|
+ ADD_TEST_SUITE(ECExplicitTriNamedCurve);
|
|
+ ADD_TEST_SUITE_LEGACY(ECExplicitTriNamedCurve);
|
|
+@@ -1427,7 +1427,7 @@ void cleanup_tests(void)
|
|
+ {
|
|
+ #ifndef OPENSSL_NO_EC
|
|
+ OSSL_PARAM_free(ec_explicit_prime_params_nc);
|
|
+- OSSL_PARAM_free(ec_explicit_prime_params_explicit);
|
|
++/* OSSL_PARAM_free(ec_explicit_prime_params_explicit);*/
|
|
+ OSSL_PARAM_BLD_free(bld_prime_nc);
|
|
+ OSSL_PARAM_BLD_free(bld_prime);
|
|
+ # ifndef OPENSSL_NO_EC2M
|
|
+@@ -1449,7 +1449,7 @@ void cleanup_tests(void)
|
|
+ #ifndef OPENSSL_NO_EC
|
|
+ FREE_DOMAIN_KEYS(EC);
|
|
+ FREE_DOMAIN_KEYS(ECExplicitPrimeNamedCurve);
|
|
+- FREE_DOMAIN_KEYS(ECExplicitPrime2G);
|
|
++/* FREE_DOMAIN_KEYS(ECExplicitPrime2G);*/
|
|
+ # ifndef OPENSSL_NO_EC2M
|
|
+ FREE_DOMAIN_KEYS(ECExplicitTriNamedCurve);
|
|
+ FREE_DOMAIN_KEYS(ECExplicitTri2G);
|
|
+diff -up openssl-3.0.1/test/recipes/30-test_evp_data/evppkey_ecdsa.txt.disable_explicit_ec openssl-3.0.1/test/recipes/30-test_evp_data/evppkey_ecdsa.txt
|
|
+--- openssl-3.0.1/test/recipes/30-test_evp_data/evppkey_ecdsa.txt.disable_explicit_ec 2022-03-25 11:20:50.920949208 +0100
|
|
++++ openssl-3.0.1/test/recipes/30-test_evp_data/evppkey_ecdsa.txt 2022-03-25 11:21:13.177147598 +0100
|
|
+@@ -121,18 +121,6 @@ AAAA//////////+85vqtpxeehPO5ysL8YyVRAgEB
|
|
+ 3ev1gTwRBduzqqlwd54AUSgI+pjttW8zrWNitO8H1sf59MPWOESKxNtZ1+Nl
|
|
+ -----END PRIVATE KEY-----
|
|
+
|
|
+-PrivateKey = EC_EXPLICIT
|
|
+------BEGIN PRIVATE KEY-----
|
|
+-MIIBeQIBADCCAQMGByqGSM49AgEwgfcCAQEwLAYHKoZIzj0BAQIhAP////8AAAAB
|
|
+-AAAAAAAAAAAAAAAA////////////////MFsEIP////8AAAABAAAAAAAAAAAAAAAA
|
|
+-///////////////8BCBaxjXYqjqT57PrvVV2mIa8ZR0GsMxTsPY7zjw+J9JgSwMV
|
|
+-AMSdNgiG5wSTamZ44ROdJreBn36QBEEE5JcIvn36opqjEm/k59Al40rBAxWM2TPG
|
|
+-l0L13Je51zHpfXQ9Z2o7IQicMXP4wSfJ0qCgg2bgydqoxlYrlLGuVQIhAP////8A
|
|
+-AAAA//////////+85vqtpxeehPO5ysL8YyVRAgEBBG0wawIBAQQgec92jwduadCk
|
|
+-OjoNRI+YT5Be5TkzZXzYCyTLkMOikDmhRANCAATtECEhQbLEaiUj/Wu0qjcr81lL
|
|
+-46dx5zYgArz/iaSNJ3W80oO+F7v04jlQ7wxQzg96R0bwKiMeq5CcW9ZFt6xg
|
|
+------END PRIVATE KEY-----
|
|
+-
|
|
+ PrivateKey = B-163
|
|
+ -----BEGIN PRIVATE KEY-----
|
|
+ MGMCAQAwEAYHKoZIzj0CAQYFK4EEAA8ETDBKAgEBBBUDnQW0mLiHVha/jqFznX/K
|
|
+diff -up openssl-3.0.9/test/ectest.c.noec openssl-3.0.9/test/ectest.c
|
|
+--- openssl-3.0.9/test/ectest.c.noec 2023-07-27 11:30:24.078979261 +0200
|
|
++++ openssl-3.0.9/test/ectest.c 2023-07-27 11:35:12.335576107 +0200
|
|
+@@ -2301,10 +2301,11 @@ static int do_test_custom_explicit_fromd
|
|
+ if (!TEST_ptr(params = OSSL_PARAM_BLD_to_param(bld))
|
|
+ || !TEST_ptr(pctx = EVP_PKEY_CTX_new_from_name(NULL, "EC", NULL))
|
|
+ || !TEST_int_gt(EVP_PKEY_fromdata_init(pctx), 0)
|
|
+- || !TEST_int_gt(EVP_PKEY_fromdata(pctx, &pkeyparam,
|
|
++ || !TEST_int_le(EVP_PKEY_fromdata(pctx, &pkeyparam,
|
|
+ EVP_PKEY_KEY_PARAMETERS, params), 0))
|
|
+ goto err;
|
|
+-
|
|
++/* As creating the key should fail, the rest of the test is pointless */
|
|
++# if 0
|
|
+ /*- Check that all the set values are retrievable -*/
|
|
+
|
|
+ /* There should be no match to a group name since the generator changed */
|
|
+@@ -2433,6 +2434,7 @@ static int do_test_custom_explicit_fromd
|
|
+ #endif
|
|
+ )
|
|
+ goto err;
|
|
++#endif
|
|
+ ret = 1;
|
|
+ err:
|
|
+ BN_free(order_out);
|
|
+@@ -2714,21 +2716,21 @@ static int custom_params_test(int id)
|
|
+
|
|
+ /* Compute keyexchange in both directions */
|
|
+ if (!TEST_ptr(pctx1 = EVP_PKEY_CTX_new(pkey1, NULL))
|
|
+- || !TEST_int_eq(EVP_PKEY_derive_init(pctx1), 1)
|
|
+- || !TEST_int_eq(EVP_PKEY_derive_set_peer(pctx1, pkey2), 1)
|
|
++ || !TEST_int_le(EVP_PKEY_derive_init(pctx1), 0)
|
|
++/* || !TEST_int_eq(EVP_PKEY_derive_set_peer(pctx1, pkey2), 1)
|
|
+ || !TEST_int_eq(EVP_PKEY_derive(pctx1, NULL, &sslen), 1)
|
|
+ || !TEST_int_gt(bsize, sslen)
|
|
+- || !TEST_int_eq(EVP_PKEY_derive(pctx1, buf1, &sslen), 1))
|
|
++ || !TEST_int_eq(EVP_PKEY_derive(pctx1, buf1, &sslen), 1)*/)
|
|
+ goto err;
|
|
+ if (!TEST_ptr(pctx2 = EVP_PKEY_CTX_new(pkey2, NULL))
|
|
+- || !TEST_int_eq(EVP_PKEY_derive_init(pctx2), 1)
|
|
+- || !TEST_int_eq(EVP_PKEY_derive_set_peer(pctx2, pkey1), 1)
|
|
++ || !TEST_int_le(EVP_PKEY_derive_init(pctx2), 1)
|
|
++/* || !TEST_int_eq(EVP_PKEY_derive_set_peer(pctx2, pkey1), 1)
|
|
+ || !TEST_int_eq(EVP_PKEY_derive(pctx2, NULL, &t), 1)
|
|
+ || !TEST_int_gt(bsize, t)
|
|
+ || !TEST_int_le(sslen, t)
|
|
+- || !TEST_int_eq(EVP_PKEY_derive(pctx2, buf2, &t), 1))
|
|
++ || !TEST_int_eq(EVP_PKEY_derive(pctx2, buf2, &t), 1) */)
|
|
+ goto err;
|
|
+-
|
|
++#if 0
|
|
+ /* Both sides should expect the same shared secret */
|
|
+ if (!TEST_mem_eq(buf1, sslen, buf2, t))
|
|
+ goto err;
|
|
+@@ -2780,7 +2782,7 @@ static int custom_params_test(int id)
|
|
+ /* compare with previous result */
|
|
+ || !TEST_mem_eq(buf1, t, buf2, sslen))
|
|
+ goto err;
|
|
+-
|
|
++#endif
|
|
+ ret = 1;
|
|
+
|
|
+ err:
|
|
--
|
|
2.46.0
|
|
|