Skip to content

Commit 457188f

Browse files
authored
Merge pull request #7070 from dgarske/cryptocb_moreinfo
Fixes for TLS with crypto callbacks
2 parents fc3977f + 1c4d728 commit 457188f

19 files changed

Lines changed: 1046 additions & 314 deletions

File tree

doc/dox_comments/header_files/aes.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -668,13 +668,13 @@ int wc_AesCcmDecrypt(Aes* aes, byte* out,
668668
669669
\param aes AES keys for encrypt/decrypt process
670670
\param heap heap hint to use for memory. Can be NULL
671-
\param devId id to use with async crypto. Can be 0
671+
\param devId ID to use with crypto callbacks or async hardware. Set to INVALID_DEVID (-2) if not used
672672
673673
_Example_
674674
\code
675675
XtsAes aes;
676676
677-
if(wc_AesXtsInit(&aes, NULL, 0) != 0)
677+
if(wc_AesXtsInit(&aes, NULL, INVALID_DEVID) != 0)
678678
{
679679
// Handle error
680680
}
@@ -749,13 +749,13 @@ int wc_AesXtsSetKeyNoInit(XtsAes* aes, const byte* key,
749749
i.e. 32 for a 16 byte key.
750750
\param dir direction, either AES_ENCRYPTION or AES_DECRYPTION
751751
\param heap heap hint to use for memory. Can be NULL
752-
\param devId id to use with async crypto. Can be 0
752+
\param devId ID to use with crypto callbacks or async hardware. Set to INVALID_DEVID (-2) if not used
753753
754754
_Example_
755755
\code
756756
XtsAes aes;
757757
758-
if(wc_AesXtsSetKey(&aes, key, sizeof(key), AES_ENCRYPTION, NULL, 0) != 0)
758+
if(wc_AesXtsSetKey(&aes, key, sizeof(key), AES_ENCRYPTION, NULL, INVALID_DEVID) != 0)
759759
{
760760
// Handle error
761761
}
@@ -974,7 +974,7 @@ int wc_AesXtsFree(XtsAes* aes);
974974
975975
\param aes aes structure in to initialize
976976
\param heap heap hint to use for malloc / free if needed
977-
\param devId ID to use with async hardware
977+
\param devId ID to use with crypto callbacks or async hardware. Set to INVALID_DEVID (-2) if not used
978978
979979
_Example_
980980
\code
@@ -1455,7 +1455,7 @@ WOLFSSL_API int wc_AesEaxEncryptUpdate(AesEax* eax, byte* out,
14551455
This argument should be NULL if not used
14561456
\param authInSz size in bytes of the input authentication data
14571457
1458-
1458+
14591459
_Example_
14601460
\code
14611461
AesEax eax;
@@ -1571,8 +1571,8 @@ WOLFSSL_API int wc_AesEaxAuthDataUpdate(AesEax* eax,
15711571

15721572
/*!
15731573
\ingroup AES
1574-
\brief This function finalizes the encrypt AEAD operation, producing an auth
1575-
tag over the current authentication stream. \c eax must have been previously
1574+
\brief This function finalizes the encrypt AEAD operation, producing an auth
1575+
tag over the current authentication stream. \c eax must have been previously
15761576
initialized with a call to \ref wc_AesEaxInit. When done using the \c AesEax
15771577
context structure, make sure to free it using \ref wc_AesEaxFree.
15781578
@@ -1632,10 +1632,10 @@ WOLFSSL_API int wc_AesEaxEncryptFinal(AesEax* eax,
16321632

16331633
/*!
16341634
\ingroup AES
1635-
\brief This function finalizes the decrypt AEAD operation, finalizing the
1635+
\brief This function finalizes the decrypt AEAD operation, finalizing the
16361636
auth tag computation and checking it for validity against the user supplied
1637-
tag. \c eax must have been previously initialized with a call to
1638-
\ref wc_AesEaxInit. When done using the \c AesEax context structure, make
1637+
tag. \c eax must have been previously initialized with a call to
1638+
\ref wc_AesEaxInit. When done using the \c AesEax context structure, make
16391639
sure to free it using \ref wc_AesEaxFree.
16401640
16411641
\return 0 if data is authenticated successfully

doc/dox_comments/header_files/cmac.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ int wc_InitCmac(Cmac* cmac,
4040
\param type Always WC_CMAC_AES = 1
4141
\param unused not used, exists for potential future use around compatibility
4242
\param heap pointer to the heap hint used for dynamic allocation. Typically used with our static memory option. Can be NULL.
43-
\param devId ID to use with async hardware. Set to INVALID_DEVID if not using async hardware.
43+
\param devId ID to use with crypto callbacks or async hardware. Set to INVALID_DEVID (-2) if not used
4444
4545
_Example_
4646
\code

doc/dox_comments/header_files/ecc.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -572,8 +572,8 @@ int wc_ecc_init(ecc_key* key);
572572
\return MEMORY_E Returned if there is an error allocating memory
573573
574574
\param key pointer to the ecc_key object to initialize
575-
\param devId ID to use with async hardware
576575
\param heap pointer to a heap identifier
576+
\param devId ID to use with crypto callbacks or async hardware. Set to INVALID_DEVID (-2) if not used
577577
578578
_Example_
579579
\code
@@ -1968,7 +1968,7 @@ int wc_ecc_decrypt(ecc_key* privKey, ecc_key* pubKey, const byte* msg,
19681968
/*!
19691969
\ingroup ECC
19701970
1971-
\brief Enable ECC support for non-blocking operations. Supported for
1971+
\brief Enable ECC support for non-blocking operations. Supported for
19721972
Single Precision (SP) math with the following build options:
19731973
WOLFSSL_SP_NONBLOCK
19741974
WOLFSSL_SP_SMALL
@@ -1978,7 +1978,7 @@ int wc_ecc_decrypt(ecc_key* privKey, ecc_key* pubKey, const byte* msg,
19781978
\return 0 Returned upon successfully setting the callback context the input message
19791979
19801980
\param key pointer to the ecc_key object
1981-
\param ctx pointer to ecc_nb_ctx_t structure with stack data cache for SP
1981+
\param ctx pointer to ecc_nb_ctx_t structure with stack data cache for SP
19821982
19831983
_Example_
19841984
\code
@@ -1998,7 +1998,7 @@ int wc_ecc_decrypt(ecc_key* privKey, ecc_key* pubKey, const byte* msg,
19981998
&key
19991999
);
20002000
2001-
// TODO: Real-time work can be called here
2001+
// TODO: Real-time work can be called here
20022002
} while (ret == FP_WOULDBLOCK);
20032003
}
20042004
wc_ecc_free(&key);

0 commit comments

Comments
 (0)