forked from wolfSSL/wolfssl
Merge pull request #1939 from cconlon/selftestfix
exclude wolfSSL_EC_POINT_point2hex() in CAVP selftest build
This commit is contained in:
@@ -26974,6 +26974,9 @@ int wolfSSL_EC_KEY_set_public_key(WOLFSSL_EC_KEY *key,
|
|||||||
/* End EC_KEY */
|
/* End EC_KEY */
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef HAVE_SELFTEST
|
||||||
|
/* ECC point compression types were not included in selftest ecc.h */
|
||||||
|
|
||||||
char* wolfSSL_EC_POINT_point2hex(const WOLFSSL_EC_GROUP* group,
|
char* wolfSSL_EC_POINT_point2hex(const WOLFSSL_EC_GROUP* group,
|
||||||
const WOLFSSL_EC_POINT* point, int form,
|
const WOLFSSL_EC_POINT* point, int form,
|
||||||
WOLFSSL_BN_CTX* ctx)
|
WOLFSSL_BN_CTX* ctx)
|
||||||
@@ -27031,6 +27034,8 @@ char* wolfSSL_EC_POINT_point2hex(const WOLFSSL_EC_GROUP* group,
|
|||||||
return hex;
|
return hex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif /* HAVE_SELFTEST */
|
||||||
|
|
||||||
void wolfSSL_EC_POINT_dump(const char *msg, const WOLFSSL_EC_POINT *p)
|
void wolfSSL_EC_POINT_dump(const char *msg, const WOLFSSL_EC_POINT *p)
|
||||||
{
|
{
|
||||||
#if defined(DEBUG_WOLFSSL)
|
#if defined(DEBUG_WOLFSSL)
|
||||||
|
@@ -1431,8 +1431,11 @@ static void test_wolfSSL_EC(void)
|
|||||||
/* NISTP256R1 Gx/Gy */
|
/* NISTP256R1 Gx/Gy */
|
||||||
const char* kGx = "6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296";
|
const char* kGx = "6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296";
|
||||||
const char* kGy = "4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5";
|
const char* kGy = "4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5";
|
||||||
|
|
||||||
|
#ifndef HAVE_SELFTEST
|
||||||
const char* uncompG = "046B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C2964FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5";
|
const char* uncompG = "046B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C2964FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5";
|
||||||
const char* compG = "036B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296";
|
const char* compG = "036B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296";
|
||||||
|
#endif
|
||||||
|
|
||||||
AssertNotNull(ctx = BN_CTX_new());
|
AssertNotNull(ctx = BN_CTX_new());
|
||||||
AssertNotNull(group = EC_GROUP_new_by_curve_name(NID_X9_62_prime256v1));
|
AssertNotNull(group = EC_GROUP_new_by_curve_name(NID_X9_62_prime256v1));
|
||||||
@@ -1489,6 +1492,7 @@ static void test_wolfSSL_EC(void)
|
|||||||
#endif
|
#endif
|
||||||
XFREE(hexStr, NULL, DYNAMIC_TYPE_ECC);
|
XFREE(hexStr, NULL, DYNAMIC_TYPE_ECC);
|
||||||
|
|
||||||
|
#ifndef HAVE_SELFTEST
|
||||||
hexStr = EC_POINT_point2hex(group, Gxy, POINT_CONVERSION_UNCOMPRESSED, ctx);
|
hexStr = EC_POINT_point2hex(group, Gxy, POINT_CONVERSION_UNCOMPRESSED, ctx);
|
||||||
AssertStrEQ(hexStr, uncompG);
|
AssertStrEQ(hexStr, uncompG);
|
||||||
XFREE(hexStr, NULL, DYNAMIC_TYPE_ECC);
|
XFREE(hexStr, NULL, DYNAMIC_TYPE_ECC);
|
||||||
@@ -1496,6 +1500,7 @@ static void test_wolfSSL_EC(void)
|
|||||||
hexStr = EC_POINT_point2hex(group, Gxy, POINT_CONVERSION_COMPRESSED, ctx);
|
hexStr = EC_POINT_point2hex(group, Gxy, POINT_CONVERSION_COMPRESSED, ctx);
|
||||||
AssertStrEQ(hexStr, compG);
|
AssertStrEQ(hexStr, compG);
|
||||||
XFREE(hexStr, NULL, DYNAMIC_TYPE_ECC);
|
XFREE(hexStr, NULL, DYNAMIC_TYPE_ECC);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* cleanup */
|
/* cleanup */
|
||||||
BN_free(X);
|
BN_free(X);
|
||||||
|
@@ -184,10 +184,12 @@ WOLFSSL_API
|
|||||||
int wolfSSL_EC_POINT_is_at_infinity(const WOLFSSL_EC_GROUP *group,
|
int wolfSSL_EC_POINT_is_at_infinity(const WOLFSSL_EC_GROUP *group,
|
||||||
const WOLFSSL_EC_POINT *a);
|
const WOLFSSL_EC_POINT *a);
|
||||||
|
|
||||||
|
#ifndef HAVE_SELFTEST
|
||||||
WOLFSSL_API
|
WOLFSSL_API
|
||||||
char* wolfSSL_EC_POINT_point2hex(const WOLFSSL_EC_GROUP* group,
|
char* wolfSSL_EC_POINT_point2hex(const WOLFSSL_EC_GROUP* group,
|
||||||
const WOLFSSL_EC_POINT* point, int form,
|
const WOLFSSL_EC_POINT* point, int form,
|
||||||
WOLFSSL_BN_CTX* ctx);
|
WOLFSSL_BN_CTX* ctx);
|
||||||
|
#endif
|
||||||
|
|
||||||
#define EC_KEY_new wolfSSL_EC_KEY_new
|
#define EC_KEY_new wolfSSL_EC_KEY_new
|
||||||
#define EC_KEY_free wolfSSL_EC_KEY_free
|
#define EC_KEY_free wolfSSL_EC_KEY_free
|
||||||
@@ -218,7 +220,10 @@ char* wolfSSL_EC_POINT_point2hex(const WOLFSSL_EC_GROUP* group,
|
|||||||
#define EC_POINT_cmp wolfSSL_EC_POINT_cmp
|
#define EC_POINT_cmp wolfSSL_EC_POINT_cmp
|
||||||
#define EC_POINT_is_at_infinity wolfSSL_EC_POINT_is_at_infinity
|
#define EC_POINT_is_at_infinity wolfSSL_EC_POINT_is_at_infinity
|
||||||
|
|
||||||
|
#ifndef HAVE_SELFTEST
|
||||||
#define EC_POINT_point2hex wolfSSL_EC_POINT_point2hex
|
#define EC_POINT_point2hex wolfSSL_EC_POINT_point2hex
|
||||||
|
#endif
|
||||||
|
|
||||||
#define EC_POINT_dump wolfSSL_EC_POINT_dump
|
#define EC_POINT_dump wolfSSL_EC_POINT_dump
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
Reference in New Issue
Block a user