From 06bca66a6523e976d31b496f898cd3336dec7410 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Henrik=20Grubbstr=C3=B6m=20=28Grubba=29?=
 <grubba@grubba.org>
Date: Fri, 3 Dec 2021 12:55:54 +0100
Subject: [PATCH] Nettle.CCM: Fix NULL-deref in digest().

Fixes issue reported in LysLysKOM 25080935.

Fixes #10072.

enter the commit message for your changes. Lines starting
---
 src/post_modules/Nettle/cipher.cmod | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/post_modules/Nettle/cipher.cmod b/src/post_modules/Nettle/cipher.cmod
index 3417cadcf2..7706aadb3e 100644
--- a/src/post_modules/Nettle/cipher.cmod
+++ b/src/post_modules/Nettle/cipher.cmod
@@ -3478,6 +3478,7 @@ PIKECLASS BlockCipher16
 	if (!pstr->len) {
 	  // Unlikely, but make sure that it is initialized.
 	  blockcipher16_ccm_init_mac_mask("digest");
+	  mac_mask = THIS->mac_mask;
 	}
 
 	if (THIS->ctr->crypt_state && THIS->ctr->crypt_state->crypt) {
-- 
GitLab