mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 02:37:28 +02:00
Fix devId, which must be -2
or INVALID_DEVID
(not 0). Fix RSA doc typo.
This commit is contained in:
@ -123,7 +123,7 @@ WOLFSSL_API int wc_RsaSetRNG(RsaKey* key, WC_RNG* rng);
|
||||
_Example_
|
||||
\code
|
||||
RsaKey enc;
|
||||
wc_RsaInitKey(&enc, NULL); // not using heap hint. No custom memory
|
||||
wc_InitRsaKey(&enc, NULL); // not using heap hint. No custom memory
|
||||
... set key, do encryption
|
||||
|
||||
wc_FreeRsaKey(&enc);
|
||||
@ -1367,7 +1367,7 @@ WOLFSSL_API int wc_RsaFlattenPublicKey(RsaKey*, byte*, word32*, byte*,
|
||||
\code
|
||||
RsaKey key;
|
||||
|
||||
wc_RsaInitKey(&key, NULL);
|
||||
wc_InitRsaKey(&key, NULL);
|
||||
// Use key
|
||||
|
||||
const int BUFFER_SIZE = 1024; // Some adequate size for the buffer
|
||||
@ -1379,7 +1379,7 @@ WOLFSSL_API int wc_RsaFlattenPublicKey(RsaKey*, byte*, word32*, byte*,
|
||||
|
||||
\sa wc_RsaPublicKeyDerSize
|
||||
\sa wc_RsaKeyToPublicDer_ex
|
||||
\sa wc_RsaInitKey
|
||||
\sa wc_InitRsaKey
|
||||
*/
|
||||
WOLFSSL_API int wc_RsaKeyToPublicDer(RsaKey* key, byte* output, word32 inLen);
|
||||
|
||||
@ -1403,7 +1403,7 @@ WOLFSSL_API int wc_RsaKeyToPublicDer(RsaKey* key, byte* output, word32 inLen);
|
||||
\code
|
||||
RsaKey key;
|
||||
|
||||
wc_RsaInitKey(&key, NULL);
|
||||
wc_InitRsaKey(&key, NULL);
|
||||
// Use key
|
||||
|
||||
const int BUFFER_SIZE = 1024; // Some adequate size for the buffer
|
||||
@ -1415,7 +1415,7 @@ WOLFSSL_API int wc_RsaKeyToPublicDer(RsaKey* key, byte* output, word32 inLen);
|
||||
|
||||
\sa wc_RsaPublicKeyDerSize
|
||||
\sa wc_RsaKeyToPublicDer
|
||||
\sa wc_RsaInitKey
|
||||
\sa wc_InitRsaKey
|
||||
*/
|
||||
WOLFSSL_API int wc_RsaKeyToPublicDer_ex(RsaKey* key, byte* output, word32 inLen,
|
||||
int with_header);
|
||||
@ -1511,7 +1511,7 @@ WOLFSSL_API int wc_MakeRsaKey(RsaKey* key, int size, long e, WC_RNG* rng);
|
||||
RsaKey key;
|
||||
RsaNb nb;
|
||||
|
||||
wc_RsaInitKey(&key, NULL);
|
||||
wc_InitRsaKey(&key, NULL);
|
||||
|
||||
// Enable non-blocking RSA mode - provide context
|
||||
ret = wc_RsaSetNonBlock(key, &nb);
|
||||
@ -1558,7 +1558,7 @@ WOLFSSL_API int wc_RsaSetNonBlock(RsaKey* key, RsaNb* nb);
|
||||
RsaKey key;
|
||||
RsaNb nb;
|
||||
|
||||
wc_RsaInitKey(&key, NULL);
|
||||
wc_InitRsaKey(&key, NULL);
|
||||
wc_RsaSetNonBlock(key, &nb);
|
||||
wc_RsaSetNonBlockTime(&key, 4000, 160); // Block Max = 4 ms, CPU = 160MHz
|
||||
|
||||
|
16
src/ssl.c
16
src/ssl.c
@ -18804,7 +18804,7 @@ size_t wolfSSL_get_client_random(const WOLFSSL* ssl, unsigned char* out,
|
||||
(void)sizeof(sha_test);
|
||||
|
||||
WOLFSSL_ENTER("SHA3_224_Init");
|
||||
ret = wc_InitSha3_224((wc_Sha3*)sha, NULL, 0);
|
||||
ret = wc_InitSha3_224((wc_Sha3*)sha, NULL, INVALID_DEVID);
|
||||
|
||||
/* return 1 on success, 0 otherwise */
|
||||
if (ret == 0)
|
||||
@ -18916,7 +18916,7 @@ size_t wolfSSL_get_client_random(const WOLFSSL* ssl, unsigned char* out,
|
||||
(void)sizeof(sha_test);
|
||||
|
||||
WOLFSSL_ENTER("SHA3_384_Init");
|
||||
ret = wc_InitSha3_384((wc_Sha3*)sha, NULL, 0);
|
||||
ret = wc_InitSha3_384((wc_Sha3*)sha, NULL, INVALID_DEVID);
|
||||
|
||||
/* return 1 on success, 0 otherwise */
|
||||
if (ret == 0)
|
||||
@ -18973,7 +18973,7 @@ size_t wolfSSL_get_client_random(const WOLFSSL* ssl, unsigned char* out,
|
||||
(void)sizeof(sha_test);
|
||||
|
||||
WOLFSSL_ENTER("SHA3_512_Init");
|
||||
ret = wc_InitSha3_512((wc_Sha3*)sha, NULL, 0);
|
||||
ret = wc_InitSha3_512((wc_Sha3*)sha, NULL, INVALID_DEVID);
|
||||
|
||||
/* return 1 on success, 0 otherwise */
|
||||
if (ret == 0)
|
||||
@ -62269,7 +62269,7 @@ int wolfSSL_PKCS12_verify_mac(WC_PKCS12 *pkcs12, const char *psw,
|
||||
|
||||
WOLFSSL_ENTER("wolfSSL_SHA1");
|
||||
|
||||
if (wc_InitSha_ex(&sha, NULL, 0) != 0) {
|
||||
if (wc_InitSha_ex(&sha, NULL, INVALID_DEVID) != 0) {
|
||||
WOLFSSL_MSG("SHA1 Init failed");
|
||||
return NULL;
|
||||
}
|
||||
@ -62316,7 +62316,7 @@ int wolfSSL_PKCS12_verify_mac(WC_PKCS12 *pkcs12, const char *psw,
|
||||
|
||||
WOLFSSL_ENTER("wolfSSL_SHA224");
|
||||
|
||||
if (wc_InitSha224_ex(&sha, NULL, 0) != 0) {
|
||||
if (wc_InitSha224_ex(&sha, NULL, INVALID_DEVID) != 0) {
|
||||
WOLFSSL_MSG("SHA224 Init failed");
|
||||
return NULL;
|
||||
}
|
||||
@ -62363,7 +62363,7 @@ int wolfSSL_PKCS12_verify_mac(WC_PKCS12 *pkcs12, const char *psw,
|
||||
|
||||
WOLFSSL_ENTER("wolfSSL_SHA256");
|
||||
|
||||
if (wc_InitSha256_ex(&sha, NULL, 0) != 0) {
|
||||
if (wc_InitSha256_ex(&sha, NULL, INVALID_DEVID) != 0) {
|
||||
WOLFSSL_MSG("SHA256 Init failed");
|
||||
return NULL;
|
||||
}
|
||||
@ -62410,7 +62410,7 @@ int wolfSSL_PKCS12_verify_mac(WC_PKCS12 *pkcs12, const char *psw,
|
||||
|
||||
WOLFSSL_ENTER("wolfSSL_SHA384");
|
||||
|
||||
if (wc_InitSha384_ex(&sha, NULL, 0) != 0) {
|
||||
if (wc_InitSha384_ex(&sha, NULL, INVALID_DEVID) != 0) {
|
||||
WOLFSSL_MSG("SHA384 Init failed");
|
||||
return NULL;
|
||||
}
|
||||
@ -62457,7 +62457,7 @@ int wolfSSL_PKCS12_verify_mac(WC_PKCS12 *pkcs12, const char *psw,
|
||||
|
||||
WOLFSSL_ENTER("wolfSSL_SHA512");
|
||||
|
||||
if (wc_InitSha512_ex(&sha, NULL, 0) != 0) {
|
||||
if (wc_InitSha512_ex(&sha, NULL, INVALID_DEVID) != 0) {
|
||||
WOLFSSL_MSG("SHA512 Init failed");
|
||||
return NULL;
|
||||
}
|
||||
|
Reference in New Issue
Block a user