s3:smbd: Use GnuTLS for AES constants
authorAndreas Schneider <asn@samba.org>
Tue, 26 Feb 2019 17:11:27 +0000 (18:11 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Wed, 21 Aug 2019 09:57:32 +0000 (09:57 +0000)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Adapted to remove Samba AES

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
source3/smbd/smb2_sesssetup.c

index d6900665a950bd102aeb606fa6b825de129329dc..82ac1182ecc0935794dbd43b036c6f04a724221a 100644 (file)
@@ -28,9 +28,6 @@
 #include "../lib/tsocket/tsocket.h"
 #include "../libcli/security/security.h"
 #include "../lib/util/tevent_ntstatus.h"
-#include "lib/crypto/aes.h"
-#include "lib/crypto/aes_ccm_128.h"
-#include "lib/crypto/aes_gcm_128.h"
 
 #include "lib/crypto/gnutls_helpers.h"
 #include <gnutls/gnutls.h>
@@ -443,10 +440,10 @@ static NTSTATUS smbd_smb2_auth_generic_return(struct smbXsrv_session *session,
                                      sizeof(x->nonce_high_random));
                switch (xconn->smb2.server.cipher) {
                case SMB2_ENCRYPTION_AES128_CCM:
-                       nonce_size = AES_CCM_128_NONCE_SIZE;
+                       nonce_size = SMB2_AES_128_CCM_NONCE_SIZE;
                        break;
                case SMB2_ENCRYPTION_AES128_GCM:
-                       nonce_size = AES_GCM_128_IV_SIZE;
+                       nonce_size = gnutls_cipher_get_iv_size(GNUTLS_CIPHER_AES_128_GCM);
                        break;
                default:
                        nonce_size = 0;