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:
John Safranek
2013-12-23 22:32:08 -08:00
parent 14aa114854
commit 4ce2e59adf
2 changed files with 12 additions and 1 deletions

View File

@ -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_GetServerWriteIV(CYASSL*);
CYASSL_API int CyaSSL_GetKeySize(CYASSL*);
CYASSL_API int CyaSSL_GetIVSize(CYASSL*);
CYASSL_API int CyaSSL_GetSide(CYASSL*);
CYASSL_API int CyaSSL_IsTLSv1_1(CYASSL*);
CYASSL_API int CyaSSL_GetBulkCipher(CYASSL*);

View File

@ -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)
{
if (ssl)
@ -976,8 +985,9 @@ int CyaSSL_GetSide(CYASSL* ssl)
int CyaSSL_GetHmacSize(CYASSL* ssl)
{
/* AEAD ciphers don't have HMAC keys */
if (ssl)
return ssl->specs.hash_size;
return (ssl->specs.cipher_type != aead) ? ssl->specs.hash_size : 0;
return BAD_FUNC_ARG;
}