mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2026-07-05 12:40:51 +02:00
src/ssl_load.c, wolfssl/ssl.h, tests/api.c: rename wolfSSL*PrivateKey_id() to wolfSSL*PrivateKey_Id_ex(), and add missing WOLF_PRIVATE_KEY_ID gating.
This commit is contained in:
+10
-10
@@ -4198,12 +4198,12 @@ int wolfSSL_CTX_use_PrivateKey_Id(WOLFSSL_CTX* ctx, const unsigned char* id,
|
||||
* @return 1 on success.
|
||||
* @return 0 on failure.
|
||||
*/
|
||||
int wolfSSL_CTX_use_PrivateKey_id(WOLFSSL_CTX* ctx, const unsigned char* id,
|
||||
int wolfSSL_CTX_use_PrivateKey_Id_ex(WOLFSSL_CTX* ctx, const unsigned char* id,
|
||||
long sz, int devId, long keySz)
|
||||
{
|
||||
int ret;
|
||||
|
||||
WOLFSSL_ENTER("wolfSSL_CTX_use_PrivateKey_id");
|
||||
WOLFSSL_ENTER("wolfSSL_CTX_use_PrivateKey_Id_ex");
|
||||
|
||||
ret = wolfSSL_CTX_use_PrivateKey_Id(ctx, id, sz, devId);
|
||||
if (ret == 1) {
|
||||
@@ -4211,7 +4211,7 @@ int wolfSSL_CTX_use_PrivateKey_id(WOLFSSL_CTX* ctx, const unsigned char* id,
|
||||
ctx->privateKeySz = (int)keySz;
|
||||
}
|
||||
|
||||
WOLFSSL_LEAVE("wolfSSL_CTX_use_PrivateKey_id", ret);
|
||||
WOLFSSL_LEAVE("wolfSSL_CTX_use_PrivateKey_Id_ex", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -4294,19 +4294,19 @@ int wolfSSL_CTX_use_AltPrivateKey_Id(WOLFSSL_CTX* ctx, const unsigned char* id,
|
||||
return ret;
|
||||
}
|
||||
|
||||
int wolfSSL_CTX_use_AltPrivateKey_id(WOLFSSL_CTX* ctx, const unsigned char* id,
|
||||
long sz, int devId, long keySz)
|
||||
int wolfSSL_CTX_use_AltPrivateKey_Id_ex(WOLFSSL_CTX* ctx,
|
||||
const unsigned char* id, long sz, int devId, long keySz)
|
||||
{
|
||||
int ret;
|
||||
|
||||
WOLFSSL_ENTER("wolfSSL_CTX_use_AltPrivateKey_id");
|
||||
WOLFSSL_ENTER("wolfSSL_CTX_use_AltPrivateKey_Id_ex");
|
||||
|
||||
ret = wolfSSL_CTX_use_AltPrivateKey_Id(ctx, id, sz, devId);
|
||||
if (ret == 1) {
|
||||
ctx->altPrivateKeySz = (word32)keySz;
|
||||
}
|
||||
|
||||
WOLFSSL_LEAVE("wolfSSL_CTX_use_AltPrivateKey_id", ret);
|
||||
WOLFSSL_LEAVE("wolfSSL_CTX_use_AltPrivateKey_Id_ex", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -4606,7 +4606,7 @@ int wolfSSL_use_PrivateKey_Id(WOLFSSL* ssl, const unsigned char* id,
|
||||
* @return 1 on success.
|
||||
* @return 0 on failure.
|
||||
*/
|
||||
int wolfSSL_use_PrivateKey_id(WOLFSSL* ssl, const unsigned char* id,
|
||||
int wolfSSL_use_PrivateKey_Id_ex(WOLFSSL* ssl, const unsigned char* id,
|
||||
long sz, int devId, long keySz)
|
||||
{
|
||||
int ret = wolfSSL_use_PrivateKey_Id(ssl, id, sz, devId);
|
||||
@@ -4703,8 +4703,8 @@ int wolfSSL_use_AltPrivateKey_Id(WOLFSSL* ssl, const unsigned char* id, long sz,
|
||||
return ret;
|
||||
}
|
||||
|
||||
int wolfSSL_use_AltPrivateKey_id(WOLFSSL* ssl, const unsigned char* id, long sz,
|
||||
int devId, long keySz)
|
||||
int wolfSSL_use_AltPrivateKey_Id_ex(WOLFSSL* ssl, const unsigned char* id,
|
||||
long sz, int devId, long keySz)
|
||||
{
|
||||
int ret = wolfSSL_use_AltPrivateKey_Id(ssl, id, sz, devId);
|
||||
if (ret == 1) {
|
||||
|
||||
+8
-6
@@ -1703,8 +1703,8 @@ static int test_dual_alg_ecdsa_mldsa(void)
|
||||
static int test_wolfSSL_use_AltPrivateKey_Id(void)
|
||||
{
|
||||
EXPECT_DECLS;
|
||||
#if defined(WOLFSSL_DUAL_ALG_CERTS) && !defined(NO_TLS) && \
|
||||
!defined(NO_WOLFSSL_CLIENT)
|
||||
#if defined(WOLF_PRIVATE_KEY_ID) && defined(WOLFSSL_DUAL_ALG_CERTS) && \
|
||||
!defined(NO_TLS) && !defined(NO_WOLFSSL_CLIENT)
|
||||
WOLFSSL_CTX* ctx = NULL;
|
||||
WOLFSSL* ssl = NULL;
|
||||
const unsigned char id[] = { 0x01, 0x02, 0x03, 0x04 };
|
||||
@@ -1724,7 +1724,8 @@ static int test_wolfSSL_use_AltPrivateKey_Id(void)
|
||||
|
||||
wolfSSL_free(ssl);
|
||||
wolfSSL_CTX_free(ctx);
|
||||
#endif /* WOLFSSL_DUAL_ALG_CERTS && !NO_TLS && !NO_WOLFSSL_CLIENT */
|
||||
#endif /* WOLF_PRIVATE_KEY_ID && WOLFSSL_DUAL_ALG_CERTS && !NO_TLS && */
|
||||
/* !NO_WOLFSSL_CLIENT */
|
||||
return EXPECT_RESULT();
|
||||
}
|
||||
|
||||
@@ -1735,8 +1736,8 @@ static int test_wolfSSL_use_AltPrivateKey_Id(void)
|
||||
static int test_wolfSSL_use_AltPrivateKey_Label(void)
|
||||
{
|
||||
EXPECT_DECLS;
|
||||
#if defined(WOLFSSL_DUAL_ALG_CERTS) && !defined(NO_TLS) && \
|
||||
!defined(NO_WOLFSSL_CLIENT)
|
||||
#if defined(WOLF_PRIVATE_KEY_ID) && defined(WOLFSSL_DUAL_ALG_CERTS) && \
|
||||
!defined(NO_TLS) && !defined(NO_WOLFSSL_CLIENT)
|
||||
WOLFSSL_CTX* ctx = NULL;
|
||||
WOLFSSL* ssl = NULL;
|
||||
|
||||
@@ -1754,7 +1755,8 @@ static int test_wolfSSL_use_AltPrivateKey_Label(void)
|
||||
|
||||
wolfSSL_free(ssl);
|
||||
wolfSSL_CTX_free(ctx);
|
||||
#endif /* WOLFSSL_DUAL_ALG_CERTS && !NO_TLS && !NO_WOLFSSL_CLIENT */
|
||||
#endif /* WOLF_PRIVATE_KEY_ID && WOLFSSL_DUAL_ALG_CERTS && !NO_TLS && */
|
||||
/* !NO_WOLFSSL_CLIENT */
|
||||
return EXPECT_RESULT();
|
||||
}
|
||||
|
||||
|
||||
+9
-5
@@ -3765,7 +3765,8 @@ WOLFSSL_API int wolfSSL_make_eap_keys(WOLFSSL* ssl, void* key, unsigned int len,
|
||||
const unsigned char* in, long sz, int format);
|
||||
WOLFSSL_API int wolfSSL_CTX_use_PrivateKey_buffer(WOLFSSL_CTX* ctx,
|
||||
const unsigned char* in, long sz, int format);
|
||||
WOLFSSL_API int wolfSSL_CTX_use_PrivateKey_id(WOLFSSL_CTX* ctx,
|
||||
#ifdef WOLF_PRIVATE_KEY_ID
|
||||
WOLFSSL_API int wolfSSL_CTX_use_PrivateKey_Id_ex(WOLFSSL_CTX* ctx,
|
||||
const unsigned char* id, long sz,
|
||||
int devId, long keySz);
|
||||
WOLFSSL_API int wolfSSL_CTX_use_PrivateKey_Id(WOLFSSL_CTX* ctx,
|
||||
@@ -3773,6 +3774,7 @@ WOLFSSL_API int wolfSSL_make_eap_keys(WOLFSSL* ssl, void* key, unsigned int len,
|
||||
int devId);
|
||||
WOLFSSL_API int wolfSSL_CTX_use_PrivateKey_Label(WOLFSSL_CTX* ctx, const char* label,
|
||||
int devId);
|
||||
#endif /* WOLF_PRIVATE_KEY_ID */
|
||||
WOLFSSL_API int wolfSSL_CTX_use_certificate_chain_buffer_format(WOLFSSL_CTX* ctx,
|
||||
const unsigned char* in, long sz, int format);
|
||||
WOLFSSL_API int wolfSSL_CTX_use_certificate_chain_buffer(WOLFSSL_CTX* ctx,
|
||||
@@ -3786,7 +3788,7 @@ WOLFSSL_API int wolfSSL_make_eap_keys(WOLFSSL* ssl, void* key, unsigned int len,
|
||||
#ifdef WOLFSSL_DUAL_ALG_CERTS
|
||||
WOLFSSL_API int wolfSSL_CTX_use_AltPrivateKey_buffer(WOLFSSL_CTX* ctx,
|
||||
const unsigned char* in, long sz, int format);
|
||||
WOLFSSL_API int wolfSSL_CTX_use_AltPrivateKey_id(WOLFSSL_CTX* ctx,
|
||||
WOLFSSL_API int wolfSSL_CTX_use_AltPrivateKey_Id_ex(WOLFSSL_CTX* ctx,
|
||||
const unsigned char* id, long sz,
|
||||
int devId, long keySz);
|
||||
WOLFSSL_API int wolfSSL_CTX_use_AltPrivateKey_Id(WOLFSSL_CTX* ctx,
|
||||
@@ -3802,7 +3804,7 @@ WOLFSSL_API int wolfSSL_make_eap_keys(WOLFSSL* ssl, void* key, unsigned int len,
|
||||
const unsigned char* der, int derSz);
|
||||
WOLFSSL_API int wolfSSL_use_PrivateKey_buffer(WOLFSSL* ssl, const unsigned char* in,
|
||||
long sz, int format);
|
||||
WOLFSSL_API int wolfSSL_use_PrivateKey_id(WOLFSSL* ssl, const unsigned char* id,
|
||||
WOLFSSL_API int wolfSSL_use_PrivateKey_Id_ex(WOLFSSL* ssl, const unsigned char* id,
|
||||
long sz, int devId, long keySz);
|
||||
WOLFSSL_API int wolfSSL_use_PrivateKey_Id(WOLFSSL* ssl, const unsigned char* id,
|
||||
long sz, int devId);
|
||||
@@ -3815,14 +3817,16 @@ WOLFSSL_API int wolfSSL_make_eap_keys(WOLFSSL* ssl, void* key, unsigned int len,
|
||||
#ifdef WOLFSSL_DUAL_ALG_CERTS
|
||||
WOLFSSL_API int wolfSSL_use_AltPrivateKey_buffer(WOLFSSL* ssl,
|
||||
const unsigned char* in, long sz, int format);
|
||||
WOLFSSL_API int wolfSSL_use_AltPrivateKey_id(WOLFSSL* ssl,
|
||||
#endif /* WOLFSSL_DUAL_ALG_CERTS */
|
||||
#ifdef WOLF_PRIVATE_KEY_ID
|
||||
WOLFSSL_API int wolfSSL_use_AltPrivateKey_Id_ex(WOLFSSL* ssl,
|
||||
const unsigned char* id, long sz,
|
||||
int devId, long keySz);
|
||||
WOLFSSL_API int wolfSSL_use_AltPrivateKey_Id(WOLFSSL* ssl,
|
||||
const unsigned char* id, long sz, int devId);
|
||||
WOLFSSL_API int wolfSSL_use_AltPrivateKey_Label(WOLFSSL* ssl,
|
||||
const char* label, int devId);
|
||||
#endif
|
||||
#endif /* WOLF_PRIVATE_KEY_ID */
|
||||
|
||||
#if (defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)) && \
|
||||
defined(KEEP_OUR_CERT)
|
||||
|
||||
Reference in New Issue
Block a user