]> git.sur5r.net Git - bacula/bacula/commitdiff
Provide a more helpful error message when no private keys are defined
authorLandon Fuller <landonf@opendarwin.org>
Thu, 2 Nov 2006 17:31:39 +0000 (17:31 +0000)
committerLandon Fuller <landonf@opendarwin.org>
Thu, 2 Nov 2006 17:31:39 +0000 (17:31 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@3594 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/filed/restore.c

index d0ec052d3de0180488d75ce4526bf76cb66ec467..c10e1225da129a7342c00c14f2d7539f79712ecd 100644 (file)
@@ -350,6 +350,12 @@ void do_restore(JCR *jcr)
 
          Dmsg1(30, "Stream=Encrypted Session Data, size: %d\n", sd->msglen);
 
+        /* Do we have any keys at all? */
+        if (!jcr->pki_recipients) {
+                Jmsg(jcr, M_ERROR, 0, _("No private decryption keys have been defined to decrypt encrypted backup data."));
+                break;
+        }
+
          /* Decode and save session keys. */
          cryptoerr = crypto_session_decode((uint8_t *)sd->msg, (uint32_t)sd->msglen, jcr->pki_recipients, &cs);
          switch(cryptoerr) {