mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-14 01:54:47 +02:00
Update to expose reasonable DER buffer sizes for Curve448/25519
This commit is contained in:
@@ -415,7 +415,7 @@ int test_wc_Ed448PublicKeyToDer(void)
|
|||||||
#if defined(HAVE_ED448) && defined(HAVE_ED448_KEY_EXPORT) && \
|
#if defined(HAVE_ED448) && defined(HAVE_ED448_KEY_EXPORT) && \
|
||||||
(defined(WOLFSSL_CERT_GEN) || defined(WOLFSSL_KEY_GEN))
|
(defined(WOLFSSL_CERT_GEN) || defined(WOLFSSL_KEY_GEN))
|
||||||
ed448_key key;
|
ed448_key key;
|
||||||
byte derBuf[1024];
|
byte derBuf[CURVE448_BUFSIZE];
|
||||||
|
|
||||||
XMEMSET(&key, 0, sizeof(ed448_key));
|
XMEMSET(&key, 0, sizeof(ed448_key));
|
||||||
|
|
||||||
@@ -458,7 +458,7 @@ int test_wc_Ed448KeyToDer(void)
|
|||||||
EXPECT_DECLS;
|
EXPECT_DECLS;
|
||||||
#if defined(HAVE_ED448) && defined(HAVE_ED448_KEY_EXPORT) && \
|
#if defined(HAVE_ED448) && defined(HAVE_ED448_KEY_EXPORT) && \
|
||||||
(defined(WOLFSSL_CERT_GEN) || defined(WOLFSSL_KEY_GEN))
|
(defined(WOLFSSL_CERT_GEN) || defined(WOLFSSL_KEY_GEN))
|
||||||
byte output[ONEK_BUF];
|
byte output[CURVE448_BUFSIZE];
|
||||||
ed448_key ed448Key;
|
ed448_key ed448Key;
|
||||||
WC_RNG rng;
|
WC_RNG rng;
|
||||||
word32 inLen;
|
word32 inLen;
|
||||||
@@ -497,7 +497,7 @@ int test_wc_Ed448PrivateKeyToDer(void)
|
|||||||
EXPECT_DECLS;
|
EXPECT_DECLS;
|
||||||
#if defined(HAVE_ED448) && defined(HAVE_ED448_KEY_EXPORT) && \
|
#if defined(HAVE_ED448) && defined(HAVE_ED448_KEY_EXPORT) && \
|
||||||
(defined(WOLFSSL_CERT_GEN) || defined(WOLFSSL_KEY_GEN))
|
(defined(WOLFSSL_CERT_GEN) || defined(WOLFSSL_KEY_GEN))
|
||||||
byte output[ONEK_BUF];
|
byte output[CURVE448_BUFSIZE];
|
||||||
ed448_key ed448PrivKey;
|
ed448_key ed448PrivKey;
|
||||||
WC_RNG rng;
|
WC_RNG rng;
|
||||||
word32 inLen;
|
word32 inLen;
|
||||||
|
@@ -35544,8 +35544,8 @@ static wc_test_ret_t curve255519_der_test(void)
|
|||||||
0xA2, 0x5B, 0x38, 0xFD, 0x96, 0xDB, 0x2A, 0x26
|
0xA2, 0x5B, 0x38, 0xFD, 0x96, 0xDB, 0x2A, 0x26
|
||||||
};
|
};
|
||||||
curve25519_key key;
|
curve25519_key key;
|
||||||
byte output[128];
|
byte output[CURVE25519_BUFSIZE];
|
||||||
word32 outputSz = 128;
|
word32 outputSz = (word32)sizeof(output);
|
||||||
word32 idx;
|
word32 idx;
|
||||||
|
|
||||||
ret = wc_curve25519_init_ex(&key, HEAP_HINT, devId);
|
ret = wc_curve25519_init_ex(&key, HEAP_HINT, devId);
|
||||||
|
@@ -45,6 +45,12 @@
|
|||||||
#define CURVE25519_KEYSIZE 32
|
#define CURVE25519_KEYSIZE 32
|
||||||
#define CURVE25519_PUB_KEY_SIZE 32
|
#define CURVE25519_PUB_KEY_SIZE 32
|
||||||
|
|
||||||
|
enum {
|
||||||
|
CURVE25519_BUFSIZE = 128, /* for exported DER keys temp buffer */
|
||||||
|
|
||||||
|
WOLF_ENUM_DUMMY_LAST_ELEMENT(CURVE25519)
|
||||||
|
};
|
||||||
|
|
||||||
#ifdef WOLFSSL_NAMES_STATIC
|
#ifdef WOLFSSL_NAMES_STATIC
|
||||||
typedef char curve25519_str[12];
|
typedef char curve25519_str[12];
|
||||||
#else
|
#else
|
||||||
|
@@ -43,6 +43,12 @@
|
|||||||
#define CURVE448_KEY_SIZE 56
|
#define CURVE448_KEY_SIZE 56
|
||||||
#define CURVE448_PUB_KEY_SIZE 56
|
#define CURVE448_PUB_KEY_SIZE 56
|
||||||
|
|
||||||
|
enum {
|
||||||
|
CURVE448_BUFSIZE = 128, /* for DER exported keys temp buffer */
|
||||||
|
|
||||||
|
WOLF_ENUM_DUMMY_LAST_ELEMENT(CURVE448)
|
||||||
|
};
|
||||||
|
|
||||||
#ifndef WC_CURVE448KEY_TYPE_DEFINED
|
#ifndef WC_CURVE448KEY_TYPE_DEFINED
|
||||||
typedef struct curve448_key curve448_key;
|
typedef struct curve448_key curve448_key;
|
||||||
#define WC_CURVE448KEY_TYPE_DEFINED
|
#define WC_CURVE448KEY_TYPE_DEFINED
|
||||||
|
Reference in New Issue
Block a user