forked from wolfSSL/wolfssl
For Atomic user:
1. Added a getter for the session's IV size. 2. The HMAC size getter should return 0 for AEAD ciphers and the hash length for the others.
This commit is contained in:
@ -1007,6 +1007,7 @@ CYASSL_API const unsigned char* CyaSSL_GetClientWriteIV(CYASSL*);
|
|||||||
CYASSL_API const unsigned char* CyaSSL_GetServerWriteKey(CYASSL*);
|
CYASSL_API const unsigned char* CyaSSL_GetServerWriteKey(CYASSL*);
|
||||||
CYASSL_API const unsigned char* CyaSSL_GetServerWriteIV(CYASSL*);
|
CYASSL_API const unsigned char* CyaSSL_GetServerWriteIV(CYASSL*);
|
||||||
CYASSL_API int CyaSSL_GetKeySize(CYASSL*);
|
CYASSL_API int CyaSSL_GetKeySize(CYASSL*);
|
||||||
|
CYASSL_API int CyaSSL_GetIVSize(CYASSL*);
|
||||||
CYASSL_API int CyaSSL_GetSide(CYASSL*);
|
CYASSL_API int CyaSSL_GetSide(CYASSL*);
|
||||||
CYASSL_API int CyaSSL_IsTLSv1_1(CYASSL*);
|
CYASSL_API int CyaSSL_IsTLSv1_1(CYASSL*);
|
||||||
CYASSL_API int CyaSSL_GetBulkCipher(CYASSL*);
|
CYASSL_API int CyaSSL_GetBulkCipher(CYASSL*);
|
||||||
|
12
src/ssl.c
12
src/ssl.c
@ -910,6 +910,15 @@ int CyaSSL_GetKeySize(CYASSL* ssl)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int CyaSSL_GetIVSize(CYASSL* ssl)
|
||||||
|
{
|
||||||
|
if (ssl)
|
||||||
|
return ssl->specs.iv_size;
|
||||||
|
|
||||||
|
return BAD_FUNC_ARG;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int CyaSSL_GetBulkCipher(CYASSL* ssl)
|
int CyaSSL_GetBulkCipher(CYASSL* ssl)
|
||||||
{
|
{
|
||||||
if (ssl)
|
if (ssl)
|
||||||
@ -976,8 +985,9 @@ int CyaSSL_GetSide(CYASSL* ssl)
|
|||||||
|
|
||||||
int CyaSSL_GetHmacSize(CYASSL* ssl)
|
int CyaSSL_GetHmacSize(CYASSL* ssl)
|
||||||
{
|
{
|
||||||
|
/* AEAD ciphers don't have HMAC keys */
|
||||||
if (ssl)
|
if (ssl)
|
||||||
return ssl->specs.hash_size;
|
return (ssl->specs.cipher_type != aead) ? ssl->specs.hash_size : 0;
|
||||||
|
|
||||||
return BAD_FUNC_ARG;
|
return BAD_FUNC_ARG;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user