- Check that the signature exists before checking
authorDuncan Mac-Vicar P <dmacvicar@suse.de>
Thu, 23 Aug 2007 22:38:44 +0000 (22:38 +0000)
committerDuncan Mac-Vicar P <dmacvicar@suse.de>
Thu, 23 Aug 2007 22:38:44 +0000 (22:38 +0000)
zypp/FileChecker.cc

index 5368eb1..15bfa21 100644 (file)
@@ -103,6 +103,12 @@ namespace zypp
   void SignatureFileChecker::operator()(const Pathname &file ) const
   {
     ZYpp::Ptr z = getZYpp();
+
+    if ( ! PathInfo(_signature).isExist())
+    {
+      ZYPP_THROW(FileCheckException("Signature " + _signature.asString() + " not found."));
+    }
+
     MIL << "checking " << file << " file validity using digital signature.." << endl;
     bool valid = z->keyRing()->verifyFileSignatureWorkflow( file, string(), _signature);
     if (!valid)