Skip to content

Commit 3179a2f

Browse files
committed
Cleanup the import function declarations.
1 parent 02c2f44 commit 3179a2f

3 files changed

Lines changed: 19 additions & 15 deletions

File tree

wolfcrypt/src/port/Renesas/renesas_tsip_rsa.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ static int tsip_RsakeyImport(TsipUserCtx* tuc)
180180
switch (tuc->wrappedKeyType) {
181181
case TSIP_KEY_TYPE_RSA1024:
182182
if (tuc->keyflgs_crypt.bits.rsapub1024_key_set != 1) {
183-
ret = tsipImportPublicKey(tuc, tuc->wrappedKeyType);
183+
ret = tsip_ImportPublicKey(tuc, tuc->wrappedKeyType);
184184

185185
WOLFSSL_MSG("tsip rsa private key 1024 not set");
186186
if (ret != 0)
@@ -190,7 +190,7 @@ static int tsip_RsakeyImport(TsipUserCtx* tuc)
190190
break;
191191
case TSIP_KEY_TYPE_RSA2048:
192192
if (tuc->keyflgs_crypt.bits.rsapub2048_key_set != 1) {
193-
ret = tsipImportPublicKey(tuc, tuc->wrappedKeyType);
193+
ret = tsip_ImportPublicKey(tuc, tuc->wrappedKeyType);
194194

195195
WOLFSSL_MSG("tsip rsa private key 2048 not set");
196196
if (ret != 0)

wolfcrypt/src/port/Renesas/renesas_tsip_util.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1679,7 +1679,7 @@ WOLFSSL_LOCAL int tsip_Tls13SendCertVerify(WOLFSSL* ssl)
16791679
}
16801680

16811681
if (ret == 0) {
1682-
ret = tsipImportPrivateKey(tuc, tuc->wrappedKeyType);
1682+
ret = tsip_ImportPrivateKey(tuc, tuc->wrappedKeyType);
16831683
}
16841684

16851685
if (ret == 0) {
@@ -1749,11 +1749,11 @@ WOLFSSL_LOCAL int tsip_Tls13SendCertVerify(WOLFSSL* ssl)
17491749

17501750
if (ret == 0) {
17511751
if (isRsa) {
1752-
ret = tsipImportPublicKey(tuc, tuc->wrappedKeyType);
1752+
ret = tsip_ImportPublicKey(tuc, tuc->wrappedKeyType);
17531753
}
17541754
else {
17551755
#if defined(WOLFSSL_CHECK_SIG_FAULTS)
1756-
ret = tsipImportPublicKey(tuc, tuc->wrappedKeyType);
1756+
ret = tsip_ImportPublicKey(tuc, tuc->wrappedKeyType);
17571757
#endif
17581758
}
17591759
}
@@ -2301,15 +2301,15 @@ static byte _tls2tsipdef(byte cipher)
23012301
* TSIP_KEY_TYPE_ECDSAP256 ecdsa p256r1 key
23022302
* TSIP_KEY_TYPE_ECDSAP384 ecdsa p384r1 key
23032303
*/
2304-
static int tsipImportPrivateKey(TsipUserCtx* tuc, int keyType)
2304+
int tsip_ImportPrivateKey(TsipUserCtx* tuc, int keyType)
23052305
{
23062306
int ret = 0;
23072307
e_tsip_err_t err = TSIP_SUCCESS;
23082308
uint8_t* provisioning_key = g_user_key_info.encrypted_provisioning_key;
23092309
uint8_t* iv = g_user_key_info.iv;
23102310
uint8_t* encPrivKey;
23112311

2312-
WOLFSSL_ENTER("tsipImportPrivateKey");
2312+
WOLFSSL_ENTER("tsip_ImportPrivateKey");
23132313

23142314
if (tuc == NULL)
23152315
return BAD_FUNC_ARG;
@@ -2377,7 +2377,7 @@ static int tsipImportPrivateKey(TsipUserCtx* tuc, int keyType)
23772377
else {
23782378
WOLFSSL_MSG("mutex locking error");
23792379
}
2380-
WOLFSSL_LEAVE("tsipImportPrivateKey", ret);
2380+
WOLFSSL_LEAVE("tsip_ImportPrivateKey", ret);
23812381
return ret;
23822382
}
23832383

@@ -2393,15 +2393,15 @@ static int tsipImportPrivateKey(TsipUserCtx* tuc, int keyType)
23932393
* TSIP_KEY_TYPE_ECDSAP256 ecdsa p256r1 key
23942394
* TSIP_KEY_TYPE_ECDSAP384 ecdsa p384r1 key
23952395
*/
2396-
WOLFSSL_LOCAL int tsipImportPublicKey(TsipUserCtx* tuc, int keyType)
2396+
WOLFSSL_LOCAL int tsip_ImportPublicKey(TsipUserCtx* tuc, int keyType)
23972397
{
23982398
int ret = 0;
23992399
e_tsip_err_t err = TSIP_SUCCESS;
24002400
uint8_t* provisioning_key = g_user_key_info.encrypted_provisioning_key;
24012401
uint8_t* iv = g_user_key_info.iv;
24022402
uint8_t* encPubKey;
24032403

2404-
WOLFSSL_ENTER("tsipImportPublicKey");
2404+
WOLFSSL_ENTER("tsip_ImportPublicKey");
24052405

24062406
if (tuc == NULL ) {
24072407
return BAD_FUNC_ARG;
@@ -2515,7 +2515,7 @@ WOLFSSL_LOCAL int tsipImportPublicKey(TsipUserCtx* tuc, int keyType)
25152515
else {
25162516
WOLFSSL_MSG("mutex locking error");
25172517
}
2518-
WOLFSSL_LEAVE("tsipImportPublicKey", ret);
2518+
WOLFSSL_LEAVE("tsip_ImportPublicKey", ret);
25192519
return ret;
25202520
}
25212521

@@ -3676,7 +3676,7 @@ WOLFSSL_LOCAL int tsip_SignRsaPkcs(wc_CryptoInfo* info, TsipUserCtx* tuc)
36763676

36773677
if (ret == 0) {
36783678
/* import private key_index from wrapped key */
3679-
ret = tsipImportPrivateKey(tuc, tuc->wrappedKeyType);
3679+
ret = tsip_ImportPrivateKey(tuc, tuc->wrappedKeyType);
36803680
}
36813681

36823682
if (ret == 0) {
@@ -3825,7 +3825,7 @@ WOLFSSL_LOCAL int tsip_VerifyRsaPkcsCb(
38253825

38263826
if (ret == 0) {
38273827
/* import public key_index from wrapped key */
3828-
ret = tsipImportPublicKey(tuc, tuc->wrappedKeyType);
3828+
ret = tsip_ImportPublicKey(tuc, tuc->wrappedKeyType);
38293829
}
38303830

38313831
if (ret == 0) {
@@ -3935,7 +3935,7 @@ WOLFSSL_LOCAL int tsip_SignEcdsa(wc_CryptoInfo* info, TsipUserCtx* tuc)
39353935

39363936
if (ret == 0) {
39373937
/* import private key_index from wrapped key */
3938-
ret = tsipImportPrivateKey(tuc, tuc->wrappedKeyType);
3938+
ret = tsip_ImportPrivateKey(tuc, tuc->wrappedKeyType);
39393939
}
39403940

39413941
if (ret == 0) {
@@ -4061,7 +4061,7 @@ WOLFSSL_LOCAL int tsip_VerifyEcdsa(wc_CryptoInfo* info, TsipUserCtx* tuc)
40614061

40624062
if (ret == 0) {
40634063
/* import public key_index from wrapped key */
4064-
ret = tsipImportPublicKey(tuc, tuc->wrappedKeyType);
4064+
ret = tsip_ImportPublicKey(tuc, tuc->wrappedKeyType);
40654065
}
40664066

40674067
if (ret == 0) {

wolfssl/wolfcrypt/port/Renesas/renesas-tsip-crypt.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,10 @@ WOLFSSL_API int tsip_set_callback_ctx(struct WOLFSSL* ssl, void* user_ctx);
379379

380380
WOLFSSL_API int tsip_set_clientPrivateKeyEnc(const byte* key, int keyType);
381381

382+
383+
WOLFSSL_LOCAL int tsip_ImportPublicKey(TsipUserCtx* tuc, int keyType);
384+
WOLFSSL_LOCAL int tsip_ImportPrivateKey(TsipUserCtx* tuc, int keyType);
385+
382386
#if defined(WOLF_PRIVATE_KEY_ID)
383387

384388
#if defined(WOLFSSL_RENESAS_TSIP_TLS)

0 commit comments

Comments
 (0)