Skip to content

Commit

Permalink
Avoid accessing the internals of the SSL_CIPHER struct.
Browse files Browse the repository at this point in the history
Avoid accessing the internals of the SSL_CIPHER struct since this has
changed size etc. over time leading to binary incompatibilities.

Task-number: QTBUG-32423
Task-number: QTBUG-23363
Change-Id: I8cb399484e3a62be7d511f4b8b22c876825c87d4
Reviewed-by: Peter Hartmann <[email protected]>
Reviewed-by: Daniel Molkentin <[email protected]>
  • Loading branch information
richmoore authored and The Qt Project committed May 19, 2014
1 parent 043529c commit 802e50c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
4 changes: 1 addition & 3 deletions src/network/ssl/qsslsocket_openssl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,7 @@ QSslCipher QSslSocketBackendPrivate::QSslCipher_from_SSL_CIPHER(SSL_CIPHER *ciph
ciph.d->encryptionMethod = descriptionList.at(4).mid(4);
ciph.d->exportable = (descriptionList.size() > 6 && descriptionList.at(6) == QLatin1String("export"));

ciph.d->bits = cipher->strength_bits;
ciph.d->supportedBits = cipher->alg_bits;

ciph.d->bits = q_SSL_CIPHER_get_bits(cipher, &ciph.d->supportedBits);
}
return ciph;
}
Expand Down
2 changes: 2 additions & 0 deletions src/network/ssl/qsslsocket_openssl_symbols.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ DEFINEFUNC2(char *, sk_value, STACK *a, a, int b, b, return 0, return)
DEFINEFUNC(int, SSL_accept, SSL *a, a, return -1, return)
DEFINEFUNC(int, SSL_clear, SSL *a, a, return -1, return)
DEFINEFUNC3(char *, SSL_CIPHER_description, SSL_CIPHER *a, a, char *b, b, int c, c, return 0, return)
DEFINEFUNC2(int, SSL_CIPHER_get_bits, SSL_CIPHER *a, a, int *b, b, return 0, return)
DEFINEFUNC(int, SSL_connect, SSL *a, a, return -1, return)
#if OPENSSL_VERSION_NUMBER >= 0x00908000L
// 0.9.8 broke SC and BC by changing this function's signature.
Expand Down Expand Up @@ -725,6 +726,7 @@ bool q_resolveOpenSslSymbols()
RESOLVEFUNC(sk_pop_free)
RESOLVEFUNC(sk_value)
RESOLVEFUNC(SSL_CIPHER_description)
RESOLVEFUNC(SSL_CIPHER_get_bits)
RESOLVEFUNC(SSL_CTX_check_private_key)
RESOLVEFUNC(SSL_CTX_ctrl)
RESOLVEFUNC(SSL_CTX_free)
Expand Down
1 change: 1 addition & 0 deletions src/network/ssl/qsslsocket_openssl_symbols_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ char * q_sk_value(STACK *a, int b);
int q_SSL_accept(SSL *a);
int q_SSL_clear(SSL *a);
char *q_SSL_CIPHER_description(SSL_CIPHER *a, char *b, int c);
int q_SSL_CIPHER_get_bits(SSL_CIPHER *a, int *b);
int q_SSL_connect(SSL *a);
#if OPENSSL_VERSION_NUMBER >= 0x00908000L
// 0.9.8 broke SC and BC by changing this function's signature.
Expand Down

0 comments on commit 802e50c

Please sign in to comment.