diff --git a/src/jrd/CryptoManager.cpp b/src/jrd/CryptoManager.cpp index 09d93531ba..999f5c72de 100644 --- a/src/jrd/CryptoManager.cpp +++ b/src/jrd/CryptoManager.cpp @@ -365,7 +365,9 @@ namespace Jrd { crypt = hdr->hdr_flags & Ods::hdr_encrypted; process = hdr->hdr_flags & Ods::hdr_crypt_process; - if ((crypt || process) && !cryptPlugin) + // tdbb w/o attachment comes when database is shutting down in the end of detachDatabase() + // the only needed here page is header, i.e. we can live w/o cryptPlugin + if ((crypt || process) && (!cryptPlugin) && tdbb->getAttachment()) { ClumpletWriter hc(ClumpletWriter::UnTagged, hdr->hdr_page_size); hdr.getClumplets(hc); @@ -388,7 +390,7 @@ namespace Jrd { hash = valid; } - if (flags & CRYPT_HDR_INIT) + if (cryptPlugin && (flags & CRYPT_HDR_INIT)) checkDigitalSignature(tdbb, hdr); }