Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/ssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -20799,9 +20799,11 @@ int wolfSSL_CIPHER_get_bits(const WOLFSSL_CIPHER *c, int *alg_bits)
WOLFSSL_ENTER("wolfSSL_CIPHER_get_bits");

#if defined(WOLFSSL_QT) || defined(OPENSSL_ALL)
(void)alg_bits;
if (c!= NULL)
if (c != NULL) {
ret = c->bits;
if (alg_bits != NULL)
*alg_bits = c->bits;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The algorithm bits is c->bits while what is returned by OpenSSL is the strength bits which may be less due to the cipher suite.
CCM_8 has a strength_bits of 64 and an algorithm bits of 128.
Integrity only cipher suites have 0 strength bits but hash length algorithm bits.

}
#else
if (c != NULL && c->ssl != NULL) {
ret = 8 * c->ssl->specs.key_size;
Expand Down
Loading