Fix crash of stream buffer if PSRAM is used
This commit is contained in:
parent
4269eca982
commit
52a95bd3e1
10
src/HAP.cpp
10
src/HAP.cpp
|
|
@ -1603,12 +1603,12 @@ void Nonce::inc(){
|
|||
//////////////////////////////////////
|
||||
|
||||
HapOut::HapStreamBuffer::HapStreamBuffer(){
|
||||
// Do not use PRAM form stream buffer, it would fail sometimes
|
||||
buffer=(char *)malloc(bufSize+1); // add 1 for adding null terminator when printing text
|
||||
encBuf=(uint8_t *)malloc(bufSize+18); // 2-byte AAD + encrypted data + 16-byte authentication tag
|
||||
|
||||
buffer=(char *)HS_MALLOC(bufSize+1); // add 1 for adding null terminator when printing text
|
||||
encBuf=(uint8_t *)HS_MALLOC(bufSize+18); // 2-byte AAD + encrypted data + 16-byte authentication tag
|
||||
|
||||
hash=(uint8_t *)HS_MALLOC(48); // space for SHA-384 hash output
|
||||
ctx = (mbedtls_sha512_context *)HS_MALLOC(sizeof(mbedtls_sha512_context)); // space for hash context
|
||||
hash=(uint8_t *)malloc(48); // space for SHA-384 hash output
|
||||
ctx = (mbedtls_sha512_context *)malloc(sizeof(mbedtls_sha512_context)); // space for hash context
|
||||
mbedtls_sha512_init(ctx); // initialize context
|
||||
mbedtls_sha512_starts_ret(ctx,1); // start SHA-384 hash (note second argument=1)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue