2 ms·
I haven't checked, but this may be due to the restriction in CCM/GCM. Here is the relevant comment/code from Samba. * CCM and GCM algorithms must never hav
by jra_samba 5y ago
I haven't checked, but this may be due to the restriction in CCM/GCM.
Here is the relevant comment/code from Samba.
* CCM and GCM algorithms must never have their
* nonce wrap, or the security of the whole
* communication and the keys is destroyed.
* We must drop the connection once we have
* transfered too much data.
*
* NOTE: We assume nonces greater than 8 bytes.
*/
...
switch (xconn->smb2.server.cipher) {
case SMB2_ENCRYPTION_AES128_CCM:
nonce_size = SMB2_AES_128_CCM_NONCE_SIZE;
break;
case SMB2_ENCRYPTION_AES128_GCM:
nonce_size = gnutls_cipher_get_iv_size(GNUTLS_CIPHER_AES_128_GCM);
break;
default:
nonce_size = 0;
break;
}
x->nonce_high_max = SMB2_NONCE_HIGH_MAX(nonce_size);
x->nonce_high = 0;
x->nonce_low = 0;
Where the definition of SMB2_NONCE_HIGH_MAX is:
#define SMB2_NONCE_HIGH_MAX(nonce_len_bytes) ((uint64_t)(\
((nonce_len_bytes) >= 16) ? UINT64_MAX : \
((nonce_len_bytes) <= 8) ? 0 : \
(((uint64_t)1 << (((nonce_len_bytes) - 8)*8)) - 1) \
))