21 #undef ZYPP_BASE_LOGGER_LOGGROUP 22 #define ZYPP_BASE_LOGGER_LOGGROUP "FileChecker" 39 MIL <<
"File " << file <<
" has no checksum available." << std::endl;
40 if ( report->askUserToAcceptNoDigest(file) )
42 MIL <<
"User accepted " << file <<
" with no checksum." << std::endl;
55 WAR <<
"File " << file <<
" has wrong checksum " << real_checksum <<
" (expected " <<
_checksum <<
")" << endl;
58 WAR <<
"User accepted " << file <<
" with WRONG CHECKSUM." << std::endl;
71 MIL <<
"+ null check on " << file << endl;
78 for ( list<FileChecker>::const_iterator it = _checkers.begin(); it != _checkers.end(); ++it )
87 ERR <<
"Invalid checker" << endl;
93 { _checkers.push_back(checker); }
97 : _signature(signature)
111 getZYpp()->keyRing()->importKey(publickey,
false);
122 MIL <<
"checking " << file <<
" file validity using digital signature.." << endl;
#define ZYPP_THROW(EXCPT)
Drops a logline and throws the Exception.
String related utilities and Regular expression matching.
SignatureFileChecker()
Default Constructor.
void operator()(const Pathname &file) const
Calls KeyRing::verifyFileSignatureWorkflow to verify the file.
void addPublicKey(const PublicKey &publickey, const KeyContext &keycontext=KeyContext())
add a public key to the list of known keys
DefaultIntegral< bool, false > _fileAccepted
void operator()(const Pathname &file) const
std::ostream & operator<<(std::ostream &str, const Exception &obj)
void add(const FileChecker &checker)
DefaultIntegral< bool, false > _fileValidated
std::string checksum() const
SignatureCheckException ExceptionType
void operator()(const Pathname &file) const
Class representing one GPG Public Key (PublicKeyData + ASCII armored in a tempfile).
std::string checksum(const Pathname &file, const std::string &algorithm)
Compute a files checksum.
void operator()(const Pathname &file) const
Try to validate the file.
function< void(const Pathname &file)> FileChecker
Functor signature used to check files.
Easy-to use interface to the ZYPP dependency resolver.
CheckSumCheckException ExceptionType
void setKeyContext(const KeyContext &keycontext)
Set context for this checker.