diff --git a/extra/wolfssl/wolfssl b/extra/wolfssl/wolfssl
index 9c87f979a7f..ceae169a34b 160000
--- a/extra/wolfssl/wolfssl
+++ b/extra/wolfssl/wolfssl
@@ -1 +1 @@
-Subproject commit 9c87f979a7f1d3a6d786b260653d566c1d31a1c4
+Subproject commit ceae169a34b82ac678a8850b2d9101c28d95c667
diff --git a/storage/innobase/row/row0import.cc b/storage/innobase/row/row0import.cc
index 7c56713a6c1..4c3ae05cd0c 100644
--- a/storage/innobase/row/row0import.cc
+++ b/storage/innobase/row/row0import.cc
@@ -1999,9 +1999,14 @@ PageConverter::update_header(
 		ib::warn() << "Space id check in the header failed: ignored";
 	}
 
-	mach_write_to_8(
-		get_frame(block) + FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION,
-		m_current_lsn);
+	const ulint offset = FSP_HEADER_OFFSET
+		+ fsp_header_get_encryption_offset(m_zip_size);
+
+	if (memcmp(get_frame(block) + offset, CRYPT_MAGIC, MAGIC_SZ) != 0) {
+		mach_write_to_8(
+			get_frame(block) + FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION,
+			m_current_lsn);
+	}
 
 	/* Write back the adjusted flags. */
 	mach_write_to_4(FSP_HEADER_OFFSET + FSP_SPACE_FLAGS
