You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are testing Botan::TLS::Session_Keys. In our test cases, we have stubbed the various functions that are called inside the Session_Keys constructor. We are using the following approach.
Callbacks_Stub _callbacks;
Handshake_IO_Stub* __io = new Handshake_IO_Stub();
Botan::TLS::Handshake_State _state(__io, _callbacks)
While creating object _state the default constructor of Ciphersuite called as m_ciphersuite is a private member of Handshake_State class.
In our test case, we create an object as follows:
We want m_ciphersuite to refer to ciphersuiteNullCipherValid, but we couldn't find any function that allows us to achieve this.
Is there any way to accomplish this? If so, please highlight it.
The reason we want to do this is that when we create the _state object, it assigns default values by default.
The text was updated successfully, but these errors were encountered:
I think it's necessary to back up a few steps here and ask what you're actually trying to do. IIUC, it's to use a PSK suite with no encryption. This is not supported.
As mentioned above, we are testing the Botan::TLS::Session_Keys Constructor.
For that we are passing _state object reference to the Session_Keys constructor as one of the arguments.
We are running our tests with UBSAN flag, and encountering runtime error: reference binding to null pointer of type 'value_type' in tls_session_key.cpp below line
The mac_keylen value is initialized in the Session_Keys constructor as mentioned below, and it is taking by default value 0 from the Ciphersuite class.
So, we need to initialize mac_keylen with non-zero values to avoid UBSAN error. If it is zero, for accessing invalid memory or failing to copy the intended data, which is likely why UBSAN is flagging an issue. The approach we followed to address this is-
_state.m_ciphersuite.m_mac_keylen = 16;
But I hope, this is not the correct way to directly modifying class members outside their intended scope. Any thoughts on this?
Botan version used: 2.19.3
We are testing Botan::TLS::Session_Keys. In our test cases, we have stubbed the various functions that are called inside the Session_Keys constructor. We are using the following approach.
While creating object _state the default constructor of Ciphersuite called as m_ciphersuite is a private member of Handshake_State class.
In our test case, we create an object as follows:
Ciphersuite ciphersuiteNullCipherValid(kIdCipherSuiteNullCipher, "TLS_PSK_WITH_NULL_SHA256", tls::Auth_Method::IMPLICIT, tls::Kex_Algo::PSK, "NullCipher", 0, "SHA-256", 32, tls::KDF_Algo::SHA_256, tls::Nonce_Format::NULL_CIPHER);
We want m_ciphersuite to refer to ciphersuiteNullCipherValid, but we couldn't find any function that allows us to achieve this.
Is there any way to accomplish this? If so, please highlight it.
The reason we want to do this is that when we create the _state object, it assigns default values by default.
The text was updated successfully, but these errors were encountered: