|| stream == STREAM_ENCRYPTED_FILE_GZIP_DATA
|| stream == STREAM_ENCRYPTED_WIN32_DATA
|| stream == STREAM_ENCRYPTED_WIN32_GZIP_DATA) {
+ if (!cipher_ctx.cipher) {
+ Jmsg1(jcr, M_ERROR, 0, _("Missing encryption session data stream for %s\n"), jcr->last_fname);
+ extract = false;
+ bclose(&bfd);
+ continue;
+ }
flags |= FO_ENCRYPT;
}
alt_flags |= FO_ENCRYPT;
/* Set up a decryption context */
- if (!alt_cipher_ctx.cipher) {
+ if (extract && !alt_cipher_ctx.cipher) {
+ if (!cs) {
+ Jmsg1(jcr, M_ERROR, 0, _("Missing encryption session data stream for %s\n"), jcr->last_fname);
+ extract = false;
+ bclose(&bfd);
+ continue;
+ }
+
if ((alt_cipher_ctx.cipher = crypto_cipher_new(cs, false, &alt_cipher_ctx.block_size)) == NULL) {
Jmsg1(jcr, M_ERROR, 0, _("Failed to initialize decryption context for %s\n"), jcr->last_fname);
crypto_session_free(cs);
cs = NULL;
extract = false;
+ bclose(&bfd);
continue;
}
}