Author: jkupec Date: Mon Sep 22 12:09:37 2008 New Revision: 11113 URL: http://svn.opensuse.org/viewcvs/zypp?rev=11113&view=rev Log: - provided context to keyring callbacks (bnc #370223) - merged trust & import callbacks (bnc #366467) (don't worry, still allows to trust && !import) Added: trunk/libzypp/zypp/KeyContext.h Modified: trunk/libzypp/tests/repo/susetags/Downloader_test.cc trunk/libzypp/tests/repo/yum/YUMDownloader_test.cc trunk/libzypp/tests/sat/SolvParsing_test.cc trunk/libzypp/tests/zypp/FileChecker_test.cc trunk/libzypp/tests/zypp/KeyRingTestReceiver.h trunk/libzypp/tests/zypp/KeyRing_test.cc trunk/libzypp/tests/zypp/RepoManager_test.cc trunk/libzypp/tools/registration/keyring-callbacks.h trunk/libzypp/zypp/CMakeLists.txt trunk/libzypp/zypp/FileChecker.cc trunk/libzypp/zypp/FileChecker.h trunk/libzypp/zypp/KeyRing.cc trunk/libzypp/zypp/KeyRing.h trunk/libzypp/zypp/repo/Downloader.cc trunk/libzypp/zypp/repo/Downloader.h trunk/libzypp/zypp/repo/susetags/Downloader.cc trunk/libzypp/zypp/repo/susetags/Downloader.h trunk/libzypp/zypp/repo/yum/Downloader.cc trunk/libzypp/zypp/repo/yum/Downloader.h Modified: trunk/libzypp/tests/repo/susetags/Downloader_test.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/tests/repo/susetags/Downl... ============================================================================== --- trunk/libzypp/tests/repo/susetags/Downloader_test.cc (original) +++ trunk/libzypp/tests/repo/susetags/Downloader_test.cc Mon Sep 22 12:09:37 2008 @@ -25,12 +25,15 @@ BOOST_AUTO_TEST_CASE(susetags_download) { KeyRingTestReceiver keyring_callbacks; - keyring_callbacks.answerTrustKey(true); + keyring_callbacks.answerAcceptKey(KeyRingReport::KEY_TRUST_TEMPORARILY); Pathname p = DATADIR + "/stable-x86-subset"; Url url("dir:" + p.asString()); MediaSetAccess media(url); - susetags::Downloader downloader("/"); + RepoInfo repoinfo; + repoinfo.setAlias("testrepo"); + repoinfo.setPath("/"); + susetags::Downloader downloader(repoinfo); filesystem::TmpDir tmp; Pathname localdir(tmp.path()); @@ -81,12 +84,15 @@ BOOST_AUTO_TEST_CASE(susetags_gz_download) { KeyRingTestReceiver keyring_callbacks; - keyring_callbacks.answerTrustKey(true); + keyring_callbacks.answerAcceptKey(KeyRingReport::KEY_TRUST_TEMPORARILY); Pathname p = DATADIR + "/stable-x86-subset-gz"; Url url("dir:" + p.asString()); MediaSetAccess media(url); - susetags::Downloader downloader("/"); + RepoInfo repoinfo; + repoinfo.setAlias("testrepo"); + repoinfo.setPath("/"); + susetags::Downloader downloader(repoinfo); filesystem::TmpDir tmp; Pathname localdir(tmp.path()); Modified: trunk/libzypp/tests/repo/yum/YUMDownloader_test.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/tests/repo/yum/YUMDownloa... ============================================================================== --- trunk/libzypp/tests/repo/yum/YUMDownloader_test.cc (original) +++ trunk/libzypp/tests/repo/yum/YUMDownloader_test.cc Mon Sep 22 12:09:37 2008 @@ -25,14 +25,17 @@ BOOST_AUTO_TEST_CASE(yum_download) { KeyRingTestReceiver keyring_callbacks; - keyring_callbacks.answerTrustKey(true); + keyring_callbacks.answerAcceptKey(KeyRingReport::KEY_TRUST_TEMPORARILY); Pathname p = DATADIR + "/10.2-updates-subset"; Url url("dir:" + p.asString()); MediaSetAccess media(url); - yum::Downloader yum("/"); + RepoInfo repoinfo; + repoinfo.setAlias("testrepo"); + repoinfo.setPath("/"); + yum::Downloader yum(repoinfo); filesystem::TmpDir tmp; - + Pathname localdir(tmp.path()); yum.download(media, localdir); Modified: trunk/libzypp/tests/sat/SolvParsing_test.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/tests/sat/SolvParsing_tes... ============================================================================== --- trunk/libzypp/tests/sat/SolvParsing_test.cc (original) +++ trunk/libzypp/tests/sat/SolvParsing_test.cc Mon Sep 22 12:09:37 2008 @@ -53,7 +53,7 @@ KeyRingTestSignalReceiver receiver; // disable sgnature checking - keyring_callbacks.answerTrustKey(true); + keyring_callbacks.answerAcceptKey(KeyRingReport::KEY_TRUST_TEMPORARILY); keyring_callbacks.answerAcceptVerFailed(true); keyring_callbacks.answerAcceptUnknownKey(true); Modified: trunk/libzypp/tests/zypp/FileChecker_test.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/tests/zypp/FileChecker_te... ============================================================================== --- trunk/libzypp/tests/zypp/FileChecker_test.cc (original) +++ trunk/libzypp/tests/zypp/FileChecker_test.cc Mon Sep 22 12:09:37 2008 @@ -40,7 +40,7 @@ KeyRingTestReceiver keyring_callbacks; KeyRingTestSignalReceiver receiver; - keyring_callbacks.answerTrustKey(true); + keyring_callbacks.answerAcceptKey(KeyRingReport::KEY_TRUST_TEMPORARILY); SignatureFileChecker sigchecker( signature ); sigchecker.addPublicKey(pubkey); sigchecker(file); @@ -54,7 +54,7 @@ KeyRingTestReceiver keyring_callbacks; KeyRingTestSignalReceiver receiver; - keyring_callbacks.answerTrustKey(true); + keyring_callbacks.answerAcceptKey(KeyRingReport::KEY_TRUST_TEMPORARILY); SignatureFileChecker sigchecker( signature ); sigchecker.addPublicKey(pubkey); Modified: trunk/libzypp/tests/zypp/KeyRingTestReceiver.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/tests/zypp/KeyRingTestRec... ============================================================================== --- trunk/libzypp/tests/zypp/KeyRingTestReceiver.h (original) +++ trunk/libzypp/tests/zypp/KeyRingTestReceiver.h Mon Sep 22 12:09:37 2008 @@ -5,6 +5,7 @@ #include "zypp/Callback.h" #include "zypp/KeyRing.h" #include "zypp/PublicKey.h" +#include "zypp/KeyContext.h" /** * Keyring Callback Receiver with some features @@ -22,13 +23,11 @@ void reset() { _answer_accept_unknown_key = false; - _answer_trust_key = false; - _answer_import_key = false; + _answer_accept_key = KeyRingReport::KEY_DONT_TRUST; _answer_ver_failed = false; _answer_accept_unsigned_file = false; _asked_user_to_accept_unknown_key = false; - _asked_user_to_trust_key = false; - _asked_user_to_import_key = false; + _asked_user_to_accept_key = false; _asked_user_to_accept_ver_failed = false; _asked_user_to_accept_unsigned_file = false; } @@ -50,52 +49,40 @@ bool askedAcceptUnknownKey() const { return _asked_user_to_accept_unknown_key; } - void answerTrustKey( bool answer ) - { _answer_trust_key = answer; } - - bool askedTrustKey() const - { return _asked_user_to_trust_key; } - - void answerImportKey( bool answer ) - { _answer_import_key = answer; } - - bool askedImportKey() const - { return _asked_user_to_import_key; } + void answerAcceptKey( KeyRingReport::KeyTrust answer ) + { _answer_accept_key = answer; } + bool askedAcceptKey() const + { return _asked_user_to_accept_key; } + void answerAcceptUnsignedFile( bool answer ) { _answer_accept_unsigned_file = answer; } bool askedAcceptUnsignedFile() const { return _asked_user_to_accept_unsigned_file; } - virtual bool askUserToAcceptUnsignedFile( const std::string &file ) + virtual bool askUserToAcceptUnsignedFile( const std::string &file, const zypp::KeyContext &keycontext ) { MIL << std::endl; _asked_user_to_accept_unsigned_file = true; return _answer_accept_unsigned_file; } - virtual bool askUserToAcceptUnknownKey( const std::string &file, const std::string &id ) + virtual bool askUserToAcceptUnknownKey( const std::string &file, const std::string &id, const zypp::KeyContext &keycontext ) { MIL << std::endl; _asked_user_to_accept_unknown_key = true; return _answer_accept_unknown_key; } - virtual bool askUserToImportKey( const zypp::PublicKey &key ) + virtual KeyRingReport::KeyTrust askUserToAcceptKey( const zypp::PublicKey &key, const zypp::KeyContext &keycontext ) { MIL << std::endl; - _asked_user_to_import_key = true; - return _answer_import_key; + _asked_user_to_accept_key = true; + return _answer_accept_key; } - virtual bool askUserToTrustKey( const zypp::PublicKey &key ) - { - MIL << std::endl; - _asked_user_to_trust_key = true; - return _answer_trust_key; - } - virtual bool askUserToAcceptVerificationFailed( const std::string &file, const zypp::PublicKey &key ) + virtual bool askUserToAcceptVerificationFailed( const std::string &file, const zypp::PublicKey &key, const zypp::KeyContext &keycontext ) { MIL << std::endl; _asked_user_to_accept_ver_failed = true; @@ -104,16 +91,14 @@ // how to answer bool _answer_accept_unknown_key; - bool _answer_trust_key; - bool _answer_import_key; + KeyRingReport::KeyTrust _answer_accept_key; bool _answer_ver_failed; bool _answer_accept_unsigned_file; // we use this variables to check that the // callbacks were called bool _asked_user_to_accept_unknown_key; - bool _asked_user_to_trust_key; - bool _asked_user_to_import_key; + bool _asked_user_to_accept_key; bool _asked_user_to_accept_ver_failed; bool _asked_user_to_accept_unsigned_file; }; Modified: trunk/libzypp/tests/zypp/KeyRing_test.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/tests/zypp/KeyRing_test.c... ============================================================================== --- trunk/libzypp/tests/zypp/KeyRing_test.cc (original) +++ trunk/libzypp/tests/zypp/KeyRing_test.cc Mon Sep 22 12:09:37 2008 @@ -30,8 +30,7 @@ /** * scenario #1 * import a not trusted key - * ask for trust, answer yes - * ask for import, answer no + * ask for accept, answer yes 'temporarily' */ { KeyRingTestReceiver keyring_callbacks; @@ -51,23 +50,21 @@ BOOST_CHECK_MESSAGE( keyring.isKeyKnown( key.id() ), "Imported untrusted key should be known"); BOOST_CHECK_MESSAGE( ! keyring.isKeyTrusted( key.id() ), "Imported untrusted key should be untrusted"); - keyring_callbacks.answerTrustKey(true); + keyring_callbacks.answerAcceptKey(KeyRingReport::KEY_TRUST_TEMPORARILY); bool to_continue = keyring.verifyFileSignatureWorkflow( DATADIR + "repomd.xml", "Blah Blah", DATADIR + "repomd.xml.asc"); BOOST_CHECK_MESSAGE( ! keyring_callbacks.askedAcceptUnknownKey(), "Should not ask for unknown key, it was known"); - BOOST_CHECK_MESSAGE( keyring_callbacks.askedTrustKey(), "Verify Signature Workflow with only 1 untrusted key should ask user wether to trust"); - BOOST_CHECK_MESSAGE( keyring_callbacks.askedImportKey(), "Trusting a key should ask for import"); + BOOST_CHECK_MESSAGE( keyring_callbacks.askedAcceptKey(), "Verify Signature Workflow with only 1 untrusted key should ask user wether to trust and/or import"); BOOST_CHECK_MESSAGE( ! keyring_callbacks.askedAcceptVerFailed(), "The signature validates"); BOOST_CHECK_MESSAGE( ! keyring_callbacks.askedAcceptUnsignedFile(), "It is a signed file, so dont ask the opposite"); BOOST_CHECK_MESSAGE( to_continue, "We did not import, but we trusted and signature validates."); } - + /** * scenario #1.1 * import a not trusted key - * ask for trust, answer yes - * ask for import, answer no + * ask to accept, answer yes 'temporarily' * vorrupt the file and check */ { @@ -82,18 +79,17 @@ keyring.importKey( key, false ); - keyring_callbacks.answerTrustKey(true); - + keyring_callbacks.answerAcceptKey(KeyRingReport::KEY_TRUST_TEMPORARILY); + // now we will recheck with a corrupted file bool to_continue = keyring.verifyFileSignatureWorkflow( DATADIR + "repomd.xml.corrupted", "Blah Blah", DATADIR + "repomd.xml.asc"); // check wether the user got the right questions BOOST_CHECK_MESSAGE( ! keyring_callbacks.askedAcceptUnknownKey(), "Should not ask for unknown key, it was known"); - BOOST_CHECK_MESSAGE( keyring_callbacks.askedTrustKey(), "Verify Signature Workflow with only 1 untrusted key should ask user wether to trust"); - BOOST_CHECK_MESSAGE( keyring_callbacks.askedImportKey(), "Trusting a key should ask for import"); + BOOST_CHECK_MESSAGE( keyring_callbacks.askedAcceptKey(), "Verify Signature Workflow with only 1 untrusted key should ask user wether to trust and/or import"); BOOST_CHECK_MESSAGE( keyring_callbacks.askedAcceptVerFailed(), "The signature does not validates"); BOOST_CHECK_MESSAGE( ! keyring_callbacks.askedAcceptUnsignedFile(), "It is a signed file, so dont ask the opposite"); - + BOOST_CHECK_MESSAGE( ! to_continue, "We did not continue with a corrupted file"); } @@ -113,14 +109,13 @@ keyring.importKey( key, false ); - keyring_callbacks.answerTrustKey(true); + keyring_callbacks.answerAcceptKey(KeyRingReport::KEY_TRUST_TEMPORARILY); // now we will recheck with a unsigned file bool to_continue = keyring.verifyFileSignatureWorkflow( DATADIR + "repomd.xml", "Blah Blah", Pathname() ); // check wether the user got the right questions BOOST_CHECK_MESSAGE( ! keyring_callbacks.askedAcceptUnknownKey(), "Should not ask for unknown key, it was known"); - BOOST_CHECK_MESSAGE( ! keyring_callbacks.askedTrustKey(), "No signature, no key to trust"); - BOOST_CHECK_MESSAGE( ! keyring_callbacks.askedImportKey(), "No signature, no key to import"); + BOOST_CHECK_MESSAGE( ! keyring_callbacks.askedAcceptKey(), "No signature, no key to trust"); BOOST_CHECK_MESSAGE( keyring_callbacks.askedAcceptUnsignedFile(), "Ask the user wether to accept an unsigned file"); BOOST_CHECK_MESSAGE( ! keyring_callbacks.askedAcceptVerFailed(), "There is no signature to verify"); @@ -138,18 +133,16 @@ // base sandbox for playing TmpDir tmp_dir; KeyRing keyring( tmp_dir.path() ); - + BOOST_CHECK_MESSAGE( ! keyring.isKeyKnown( key.id() ), "empty keyring has not known keys"); - + //keyring_callbacks.answerAcceptUnknownKey(true); bool to_continue = keyring.verifyFileSignatureWorkflow( DATADIR + "repomd.xml", "Blah Blah", DATADIR + "repomd.xml.asc"); BOOST_CHECK_MESSAGE(keyring_callbacks.askedAcceptUnknownKey(), "Should ask to accept unknown key, empty keyring"); - BOOST_CHECK_MESSAGE( ! keyring_callbacks.askedTrustKey(), "Unknown key cant be trusted"); - BOOST_CHECK_MESSAGE( ! keyring_callbacks.askedImportKey(), "Unknown key cant be imported"); - + BOOST_CHECK_MESSAGE( ! keyring_callbacks.askedAcceptKey(), "Unknown key cant be trusted"); BOOST_CHECK_MESSAGE( ! to_continue, "We answered no to accept unknown key"); } - + /** scenario #3 * import trusted key * should ask nothing @@ -166,7 +159,7 @@ BOOST_CHECK_EQUAL( keyring.trustedPublicKeys().size(), (unsigned) 0 ); keyring.importKey( key, true ); - + BOOST_CHECK_EQUAL( receiver._trusted_key_added_called, true ); BOOST_CHECK_EQUAL( keyring.publicKeys().size(), (unsigned) 0 ); @@ -178,8 +171,7 @@ bool to_continue = keyring.verifyFileSignatureWorkflow( DATADIR + "repomd.xml", "Blah Blah", DATADIR + "repomd.xml.asc"); BOOST_CHECK_MESSAGE( ! keyring_callbacks.askedAcceptUnknownKey(), "Should not ask for unknown key, it was known"); - BOOST_CHECK_MESSAGE( ! keyring_callbacks.askedTrustKey(), "Verify Signature Workflow with only 1 untrusted key should ask user wether to trust"); - BOOST_CHECK_MESSAGE( ! keyring_callbacks.askedImportKey(), "Trusting a key should ask for import"); + BOOST_CHECK_MESSAGE( ! keyring_callbacks.askedAcceptKey(), "Verify Signature Workflow with only 1 untrusted key should ask user wether to trust and/or import"); BOOST_CHECK_MESSAGE( ! keyring_callbacks.askedAcceptVerFailed(), "The signature validates"); BOOST_CHECK_MESSAGE( ! keyring_callbacks.askedAcceptUnsignedFile(), "It is a signed file, so dont ask the opposite"); Modified: trunk/libzypp/tests/zypp/RepoManager_test.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/tests/zypp/RepoManager_te... ============================================================================== --- trunk/libzypp/tests/zypp/RepoManager_test.cc (original) +++ trunk/libzypp/tests/zypp/RepoManager_test.cc Mon Sep 22 12:09:37 2008 @@ -124,7 +124,7 @@ KeyRingTestSignalReceiver receiver; // disable sgnature checking - keyring_callbacks.answerTrustKey(true); + keyring_callbacks.answerAcceptKey(KeyRingReport::KEY_TRUST_TEMPORARILY); keyring_callbacks.answerAcceptVerFailed(true); keyring_callbacks.answerAcceptUnknownKey(true); Modified: trunk/libzypp/tools/registration/keyring-callbacks.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/tools/registration/keyrin... ============================================================================== --- trunk/libzypp/tools/registration/keyring-callbacks.h (original) +++ trunk/libzypp/tools/registration/keyring-callbacks.h Mon Sep 22 12:09:37 2008 @@ -34,26 +34,22 @@ KeyRingReceive() {} - virtual bool askUserToAcceptUnsignedFile( const std::string &file ) + virtual bool askUserToAcceptUnsignedFile( const std::string &file, const zypp::KeyContext &keycontext ) { return true; } - virtual bool askUserToAcceptUnknownKey( const std::string &file, const std::string &id ) + virtual bool askUserToAcceptUnknownKey( const std::string &file, const std::string &id, const zypp::KeyContext &keycontext ) { return true; } - virtual bool askUserToImportKey( const PublicKey &key ) + virtual bool askUserAcceptKey( const PublicKey &key, const zypp::KeyContext &keycontext ) { DBG << "By default zypp-query-pool does not import keys for now." << std::endl; - return false; + return zypp::KeyRingReport::KEY_TRUST_TEMPORARILY; } - virtual bool askUserToTrustKey( const PublicKey &key ) - { - return true; - } - virtual bool askUserToAcceptVerificationFailed( const std::string &file, const PublicKey &key ) + virtual bool askUserToAcceptVerificationFailed( const std::string &file, const PublicKey &key, const zypp::KeyContext &keycontext ) { return true; } Modified: trunk/libzypp/zypp/CMakeLists.txt URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/CMakeLists.txt?rev=1... ============================================================================== --- trunk/libzypp/zypp/CMakeLists.txt (original) +++ trunk/libzypp/zypp/CMakeLists.txt Mon Sep 22 12:09:37 2008 @@ -104,6 +104,7 @@ FileChecker.h IdString.h IdStringType.h + KeyContext.h KeyRing.h KVMap.h LanguageCode.h Modified: trunk/libzypp/zypp/FileChecker.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/FileChecker.cc?rev=1... ============================================================================== --- trunk/libzypp/zypp/FileChecker.cc (original) +++ trunk/libzypp/zypp/FileChecker.cc Mon Sep 22 12:09:37 2008 @@ -94,30 +94,24 @@ } - SignatureFileChecker::SignatureFileChecker( const Pathname &signature, - const std::string &description ) + SignatureFileChecker::SignatureFileChecker( const Pathname &signature ) : _signature(signature) - , _description(description) { } - - SignatureFileChecker::SignatureFileChecker( const std::string &description ) - : _description(description) - { - } - + SignatureFileChecker::SignatureFileChecker() { } - - void SignatureFileChecker::addPublicKey( const Pathname &publickey ) + + void SignatureFileChecker::addPublicKey( const Pathname &publickey, const KeyContext & keycontext ) { ZYpp::Ptr z = getZYpp(); z->keyRing()->importKey(publickey, false); + _context = keycontext; } - + void SignatureFileChecker::operator()(const Pathname &file ) const { ZYpp::Ptr z = getZYpp(); @@ -128,7 +122,7 @@ } MIL << "checking " << file << " file validity using digital signature.." << endl; - bool valid = z->keyRing()->verifyFileSignatureWorkflow( file, _description.empty() ? file.basename() : _description, _signature); + bool valid = z->keyRing()->verifyFileSignatureWorkflow( file, file.basename(), _signature, _context); if (!valid) ZYPP_THROW( FileCheckException( "Signature verification failed for " + file.basename() ) ); Modified: trunk/libzypp/zypp/FileChecker.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/FileChecker.h?rev=11... ============================================================================== --- trunk/libzypp/zypp/FileChecker.h (original) +++ trunk/libzypp/zypp/FileChecker.h Mon Sep 22 12:09:37 2008 @@ -18,6 +18,7 @@ #include "zypp/base/Function.h" #include "zypp/PathInfo.h" #include "zypp/CheckSum.h" +#include "zypp/KeyContext.h" /////////////////////////////////////////////////////////////////// namespace zypp @@ -86,15 +87,8 @@ * Constructor. * \param signature Signature that validates the file */ - SignatureFileChecker( const Pathname &signature, - const std::string &description = std::string() ); + SignatureFileChecker( const Pathname &signature ); - /** - * Constructor for files not containing a signature - * \param description Description of the checker - */ - SignatureFileChecker( const std::string &description ); - /** * Default Constructor. * \short Signature for unsigned files @@ -102,12 +96,12 @@ * to check the user to accept an unsigned file. */ SignatureFileChecker(); - - + + /** * add a public key to the list of known keys */ - void addPublicKey( const Pathname &publickey ); + void addPublicKey( const Pathname &publickey, const KeyContext & keycontext = KeyContext()); /** * \short Try to validate the file * \param file File to validate. @@ -115,10 +109,10 @@ * \throws SignatureCheckException if validation fails */ void operator()( const Pathname &file ) const; - + protected: Pathname _signature; - std::string _description; + KeyContext _context; }; /** Added: trunk/libzypp/zypp/KeyContext.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/KeyContext.h?rev=111... ============================================================================== --- trunk/libzypp/zypp/KeyContext.h (added) +++ trunk/libzypp/zypp/KeyContext.h Mon Sep 22 12:09:37 2008 @@ -0,0 +1,24 @@ +#ifndef KEYCONTEXT_H_ +#define KEYCONTEXT_H_ + +#include "zypp/RepoInfo.h" + +namespace zypp { + + struct KeyContext + { + public: + /** Is the context unknown? */ + bool empty() const { return _repoInfo.alias().empty(); } + + public: + const RepoInfo repoInfo() const { return _repoInfo; } + void setRepoInfo(const RepoInfo & repoinfo) { _repoInfo = repoinfo; } + + private: + RepoInfo _repoInfo; + }; + +} + +#endif /*KEYCONTEXT_H_*/ Modified: trunk/libzypp/zypp/KeyRing.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/KeyRing.cc?rev=11113... ============================================================================== --- trunk/libzypp/zypp/KeyRing.cc (original) +++ trunk/libzypp/zypp/KeyRing.cc Mon Sep 22 12:09:37 2008 @@ -67,21 +67,23 @@ _keyRingDefaultAccept = value_r; } - /////////////////////////////////////////////////////////////////// - - bool KeyRingReport::askUserToAcceptUnsignedFile( const string &file ) + bool KeyRingReport::askUserToAcceptUnsignedFile( const string &file, const KeyContext &keycontext ) { return _keyRingDefaultAccept.testFlag( KeyRing::ACCEPT_UNSIGNED_FILE ); } - bool KeyRingReport::askUserToAcceptUnknownKey( const string &file, const string &id ) - { return _keyRingDefaultAccept.testFlag( KeyRing::ACCEPT_UNKNOWNKEY ); } - - bool KeyRingReport::askUserToTrustKey( const PublicKey &key ) - { return _keyRingDefaultAccept.testFlag( KeyRing::TRUST_KEY ); } + KeyRingReport::KeyTrust + KeyRingReport::askUserToAcceptKey( const PublicKey &key, const KeyContext &keycontext ) + { + if ( _keyRingDefaultAccept.testFlag( KeyRing::TRUST_KEY_TEMPORARILY ) ) + return KEY_TRUST_TEMPORARILY; + if ( _keyRingDefaultAccept.testFlag( KeyRing::TRUST_AND_IMPORT_KEY ) ) + return KEY_TRUST_AND_IMPORT; + return KEY_DONT_TRUST; + } - bool KeyRingReport::askUserToImportKey( const PublicKey &key) - { return _keyRingDefaultAccept.testFlag( KeyRing::IMPORT_KEY ); } + bool KeyRingReport::askUserToAcceptUnknownKey( const string &file, const string &id, const KeyContext &keycontext ) + { return _keyRingDefaultAccept.testFlag( KeyRing::ACCEPT_UNKNOWNKEY ); } - bool KeyRingReport::askUserToAcceptVerificationFailed( const string &file, const PublicKey &key ) + bool KeyRingReport::askUserToAcceptVerificationFailed( const string &file, const PublicKey &key, const KeyContext &keycontext ) { return _keyRingDefaultAccept.testFlag( KeyRing::ACCEPT_VERIFICATION_FAILED ); } /////////////////////////////////////////////////////////////////// @@ -115,7 +117,11 @@ void dumpPublicKey( const string &id, bool trusted, ostream &stream ); - bool verifyFileSignatureWorkflow( const Pathname &file, const string filedesc, const Pathname &signature); + bool verifyFileSignatureWorkflow( + const Pathname &file, + const string filedesc, + const Pathname &signature, + const KeyContext &keycontext = KeyContext()); bool verifyFileSignature( const Pathname &file, const Pathname &signature); bool verifyFileTrustedSignature( const Pathname &file, const Pathname &signature); @@ -320,7 +326,11 @@ } - bool KeyRing::Impl::verifyFileSignatureWorkflow( const Pathname &file, const string filedesc, const Pathname &signature) + bool KeyRing::Impl::verifyFileSignatureWorkflow( + const Pathname &file, + const string filedesc, + const Pathname &signature, + const KeyContext &context) { callback::SendReport<KeyRingReport> report; //callback::SendReport<KeyRingSignals> emitSignal; @@ -329,7 +339,7 @@ // if signature does not exists, ask user if he wants to accept unsigned file. if( signature.empty() || (!PathInfo(signature).isExist()) ) { - bool res = report->askUserToAcceptUnsignedFile( filedesc ); + bool res = report->askUserToAcceptUnsignedFile( filedesc, context ); MIL << "User decision on unsigned file: " << res << endl; return res; } @@ -363,7 +373,7 @@ if ( verifyFile( file, signature, trustedKeyRing() ) ) return true; else - return report->askUserToAcceptVerificationFailed( filedesc, key ); + return report->askUserToAcceptVerificationFailed( filedesc, key, context ); } else { @@ -372,24 +382,24 @@ PublicKey key = exportKey( id, generalKeyRing()); MIL << "Exported key " << id << " to " << key.path() << endl; MIL << "Key " << id << " " << key.name() << " is not trusted" << endl; + // ok the key is not trusted, ask the user to trust it or not - #warning We need the key details passed to the callback - if ( report->askUserToTrustKey( key ) ) + KeyRingReport::KeyTrust reply = report->askUserToAcceptKey(key, context); + if (reply == KeyRingReport::KEY_TRUST_TEMPORARILY || + reply == KeyRingReport::KEY_TRUST_AND_IMPORT) { MIL << "User wants to trust key " << id << " " << key.name() << endl; //dumpFile(unKey.path()); Pathname which_keyring; - if ( report->askUserToImportKey( key ) ) + if (reply == KeyRingReport::KEY_TRUST_AND_IMPORT) { MIL << "User wants to import key " << id << " " << key.name() << endl; importKey( key, true ); which_keyring = trustedKeyRing(); } else - { which_keyring = generalKeyRing(); - } // emit key added if ( verifyFile( file, signature, which_keyring ) ) @@ -400,7 +410,7 @@ else { MIL << "File signature check fails" << endl; - if ( report->askUserToAcceptVerificationFailed( filedesc, key ) ) + if ( report->askUserToAcceptVerificationFailed( filedesc, key, context ) ) { MIL << "User continues anyway." << endl; return true; @@ -416,13 +426,13 @@ { MIL << "User does not want to trust key " << id << " " << key.name() << endl; return false; - } + } } else { // unknown key... MIL << "File [" << file << "] ( " << filedesc << " ) signed with unknown key [" << id << "]" << endl; - if ( report->askUserToAcceptUnknownKey( filedesc, id ) ) + if ( report->askUserToAcceptUnknownKey( filedesc, id, context ) ) { MIL << "User wants to accept unknown key " << id << endl; return true; @@ -750,9 +760,13 @@ return _pimpl->trustedPublicKeyIds(); } - bool KeyRing::verifyFileSignatureWorkflow( const Pathname &file, const string filedesc, const Pathname &signature) + bool KeyRing::verifyFileSignatureWorkflow( + const Pathname &file, + const string filedesc, + const Pathname &signature, + const KeyContext &keycontext) { - return _pimpl->verifyFileSignatureWorkflow(file, filedesc, signature); + return _pimpl->verifyFileSignatureWorkflow(file, filedesc, signature, keycontext); } bool KeyRing::verifyFileSignature( const Pathname &file, const Pathname &signature) Modified: trunk/libzypp/zypp/KeyRing.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/KeyRing.h?rev=11113&... ============================================================================== --- trunk/libzypp/zypp/KeyRing.h (original) +++ trunk/libzypp/zypp/KeyRing.h Mon Sep 22 12:09:37 2008 @@ -24,6 +24,7 @@ #include "zypp/base/PtrTypes.h" #include "zypp/Locale.h" #include "zypp/PublicKey.h" +#include "zypp/KeyContext.h" /////////////////////////////////////////////////////////////////// namespace zypp @@ -42,46 +43,56 @@ */ struct KeyRingReport : public callback::ReportBase { - - /** - * The file \ref filedesc is unsigned - * \param filedesc Name of the file (repo alias) or filename if not available - */ - virtual bool askUserToAcceptUnsignedFile( const std::string &filedesc ); - /** - * we DONT know the key, only its id, but we have never seen it, the difference - * with trust key is that if you dont have it, you can't import it later. - * The answer means continue yes or no? + * User reply options for the askUserToTrustKey callback. * * \param filedes Name of the file (repo alias) or filename if not available */ - virtual bool askUserToAcceptUnknownKey( const std::string &filedesc, const std::string &id ); + typedef enum + { + /** + * User has chosen not to trust the key. + */ + KEY_DONT_TRUST = 0, + /** + * This basically means, we knew the key, but it was not trusted. User + * has chosen to continue, but not import the key. + */ + KEY_TRUST_TEMPORARILY, + /** + * Import the key. + * This means saving the key in the trusted database so next run it will appear as trusted. + * Nothing to do with KEY_TRUST_TEMPORARILY, as you CAN trust a key without importing it, + * basically you will be asked every time again. + * There are programs who prefer to manage the trust keyring on their own and use trustKey + * without importing it into rpm. + */ + KEY_TRUST_AND_IMPORT + } + KeyTrust; /** - * This basically means, we know the key, but it is not trusted, Continue - * yes or no?. Nothing else is performed (import, etc) + * Ask user to trust and/or import the key to trusted keyring. + * \see KeyTrust */ - virtual bool askUserToTrustKey( const PublicKey &key); + virtual KeyTrust askUserToAcceptKey( const PublicKey &key, const KeyContext &keycontext = KeyContext() ); + virtual bool askUserToAcceptUnsignedFile( const std::string &file, const KeyContext &keycontext = KeyContext() ); /** - * Import the key. - * This means saving the key in the trusted database so next run it will appear as trusted. - * Nothing to do with trustKey, as you CAN trust a key without importing it, - * basically you will be asked every time again. - * There are programs who prefer to manage the trust keyring on their own and use trustKey - * without importing it into rpm. + * we DONT know the key, only its id, but we have never seen it, the difference + * with trust key is that if you dont have it, you can't import it later. + * The answer means continue yes or no? * */ - virtual bool askUserToImportKey( const PublicKey &key); + virtual bool askUserToAcceptUnknownKey( const std::string &file, const std::string &id, const KeyContext &keycontext = KeyContext() ); /** * The file \ref filedesc is signed but the verification failed * - * \param filedesc Name of the file (repo alias) or filename if not available + * \param filedesc Filename or its description. */ - virtual bool askUserToAcceptVerificationFailed( const std::string &filedesc, const PublicKey &key ); + virtual bool askUserToAcceptVerificationFailed( const std::string &file, const PublicKey &key, const KeyContext &keycontext = KeyContext() ); }; @@ -140,8 +151,8 @@ ACCEPT_NOTHING = 0x0000, ACCEPT_UNSIGNED_FILE = 0x0001, ACCEPT_UNKNOWNKEY = 0x0002, - TRUST_KEY = 0x0004, - IMPORT_KEY = 0x0008, + TRUST_KEY_TEMPORARILY = 0x0004, + TRUST_AND_IMPORT_KEY = 0x0008, ACCEPT_VERIFICATION_FAILED = 0x0010, }; ZYPP_DECLARE_FLAGS( DefaultAccept, DefaultAcceptBits ); @@ -243,7 +254,12 @@ * * \see \ref KeyRingReport */ - bool verifyFileSignatureWorkflow( const Pathname &file, const std::string filedesc, const Pathname &signature); + bool verifyFileSignatureWorkflow( + const Pathname &file, + const std::string filedesc, + const Pathname &signature, + const KeyContext &keycontext = KeyContext()); + /** * Verifies a file against a signature, with no user interaction Modified: trunk/libzypp/zypp/repo/Downloader.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/repo/Downloader.cc?r... ============================================================================== --- trunk/libzypp/zypp/repo/Downloader.cc (original) +++ trunk/libzypp/zypp/repo/Downloader.cc Mon Sep 22 12:09:37 2008 @@ -28,7 +28,9 @@ Downloader::Downloader() { } - +Downloader::Downloader(const RepoInfo & repoinfo) : _repoinfo(repoinfo) +{ +} Downloader::~Downloader() { } Modified: trunk/libzypp/zypp/repo/Downloader.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/repo/Downloader.h?re... ============================================================================== --- trunk/libzypp/zypp/repo/Downloader.h (original) +++ trunk/libzypp/zypp/repo/Downloader.h Mon Sep 22 12:09:37 2008 @@ -16,6 +16,7 @@ #include "zypp/RepoStatus.h" #include "zypp/MediaSetAccess.h" #include "zypp/Fetcher.h" +#include "zypp/RepoInfo.h" namespace zypp { @@ -35,8 +36,10 @@ * \short Constructor */ Downloader(); + /** C-tor associating the downloader with a RepoInfo */ + Downloader(const RepoInfo & info); virtual ~Downloader(); - + /** * \short Download metadata to a local directory * @@ -51,9 +54,12 @@ * \short Status of the remote repository */ virtual RepoStatus status( MediaSetAccess &media ); - - }; + const RepoInfo & repoInfo() const { return _repoinfo; } + + private: + RepoInfo _repoinfo; + }; } // ns repo } // ns zypp Modified: trunk/libzypp/zypp/repo/susetags/Downloader.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/repo/susetags/Downlo... ============================================================================== --- trunk/libzypp/zypp/repo/susetags/Downloader.cc (original) +++ trunk/libzypp/zypp/repo/susetags/Downloader.cc Mon Sep 22 12:09:37 2008 @@ -14,6 +14,7 @@ #include "zypp/parser/ParseException.h" #include "zypp/parser/susetags/RepoIndex.h" #include "zypp/base/UserRequestException.h" +#include "zypp/KeyContext.h" // for SignatureFileChecker using namespace std; using namespace zypp::parser; @@ -26,23 +27,15 @@ namespace susetags { -Downloader::Downloader(const RepoInfo &info ) - : _info(info) +Downloader::Downloader( const RepoInfo &repoinfo ) + : repo::Downloader(repoinfo) { - -} - -Downloader::Downloader(const Pathname &path ) -{ - RepoInfo info; - info.setPath(path); - _info = info; } RepoStatus Downloader::status( MediaSetAccess &media ) { - Pathname content = media.provideFile( _info.path() + "/content"); - Pathname mediafile = media.provideFile( _info.path() + "/media.1/media" ); + Pathname content = media.provideFile( repoInfo().path() + "/content"); + Pathname mediafile = media.provideFile( repoInfo().path() + "/media.1/media" ); return RepoStatus(content) && RepoStatus(mediafile); } @@ -53,33 +46,35 @@ { downloadMediaInfo( dest_dir, media ); - SignatureFileChecker sigchecker(_info.name()); + SignatureFileChecker sigchecker/*(repoInfo().name())*/; - Pathname sig = _info.path() + "/content.asc"; + Pathname sig = repoInfo().path() + "/content.asc"; if ( media.doesFileExist(sig) ) { this->enqueue( OnMediaLocation( sig, 1 ) ); this->start( dest_dir, media ); this->reset(); - sigchecker = SignatureFileChecker( dest_dir + sig, _info.name() ); + sigchecker = SignatureFileChecker( dest_dir + sig/*, repoInfo().name() */); } - Pathname key = _info.path() + "/content.key"; + Pathname key = repoInfo().path() + "/content.key"; if ( media.doesFileExist(key) ) { + KeyContext context; + context.setRepoInfo(repoInfo()); this->enqueue( OnMediaLocation( key, 1 ) ); this->start( dest_dir, media ); this->reset(); - sigchecker.addPublicKey(dest_dir + key); + sigchecker.addPublicKey(dest_dir + key, context); } - if ( ! _info.gpgCheck() ) + if ( ! repoInfo().gpgCheck() ) { - WAR << "Signature checking disabled in config of repository " << _info.alias() << endl; + WAR << "Signature checking disabled in config of repository " << repoInfo().alias() << endl; } - this->enqueue( OnMediaLocation( _info.path() + "/content", 1 ), - _info.gpgCheck() ? FileChecker(sigchecker) : FileChecker(NullFileChecker()) ); + this->enqueue( OnMediaLocation( repoInfo().path() + "/content", 1 ), + repoInfo().gpgCheck() ? FileChecker(sigchecker) : FileChecker(NullFileChecker()) ); this->start( dest_dir, media ); this->reset(); @@ -87,19 +82,19 @@ // Content file first to get the repoindex { - Pathname inputfile( dest_dir + _info.path() + "/content" ); + Pathname inputfile( dest_dir + repoInfo().path() + "/content" ); ContentFileReader content; content.setRepoIndexConsumer( bind( &Downloader::consumeIndex, this, _1 ) ); content.parse( inputfile ); } if ( ! _repoindex ) { - ZYPP_THROW( ParseException( (dest_dir+_info.path()).asString() + ": " + "No repository index in content file." ) ); + ZYPP_THROW( ParseException( (dest_dir+repoInfo().path()).asString() + ": " + "No repository index in content file." ) ); } MIL << "RepoIndex: " << _repoindex << endl; if ( _repoindex->metaFileChecksums.empty() ) { - ZYPP_THROW( ParseException( (dest_dir+_info.path()).asString() + ": " + "No metadata checksums in content file." ) ); + ZYPP_THROW( ParseException( (dest_dir+repoInfo().path()).asString() + ": " + "No metadata checksums in content file." ) ); } if ( _repoindex->signingKeys.empty() ) { @@ -183,7 +178,7 @@ } } MIL << "adding job " << it->first << endl; - OnMediaLocation location( _info.path() + descr_dir + it->first, 1 ); + OnMediaLocation location( repoInfo().path() + descr_dir + it->first, 1 ); location.setChecksum( it->second ); this->enqueueDigested(location); } @@ -192,7 +187,7 @@ it != _repoindex->signingKeys.end(); ++it ) { - OnMediaLocation location( _info.path() + it->first, 1 ); + OnMediaLocation location( repoInfo().path() + it->first, 1 ); location.setChecksum( it->second ); this->enqueueDigested(location); } Modified: trunk/libzypp/zypp/repo/susetags/Downloader.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/repo/susetags/Downlo... ============================================================================== --- trunk/libzypp/zypp/repo/susetags/Downloader.h (original) +++ trunk/libzypp/zypp/repo/susetags/Downloader.h Mon Sep 22 12:09:37 2008 @@ -33,7 +33,7 @@ */ class Downloader : public repo::Downloader { - public: + public: /** * \short Constructor from the repository information * @@ -45,14 +45,6 @@ Downloader( const RepoInfo &info ); /** - * \short Constructor from the pathname relative to the - * repository url - * - * \param path Path to the repostory from the media - */ - Downloader( const Pathname &path ); - - /** * \short Download metadata to a local directory * * \param media Media access to the repository url @@ -72,8 +64,7 @@ */ void consumeIndex( const parser::susetags::RepoIndex_Ptr & data_r ); - private: - RepoInfo _info; + private: parser::susetags::RepoIndex_Ptr _repoindex; }; Modified: trunk/libzypp/zypp/repo/yum/Downloader.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/repo/yum/Downloader.... ============================================================================== --- trunk/libzypp/zypp/repo/yum/Downloader.cc (original) +++ trunk/libzypp/zypp/repo/yum/Downloader.cc Mon Sep 22 12:09:37 2008 @@ -20,6 +20,7 @@ #include "zypp/repo/MediaInfoDownloader.h" #include "zypp/base/UserRequestException.h" #include "zypp/parser/xml/Reader.h" +#include "zypp/KeyContext.h" using namespace std; using namespace zypp::xml; @@ -32,21 +33,15 @@ namespace yum { -Downloader::Downloader( const RepoInfo &info ) - : _info(info), _media_ptr(0L) +Downloader::Downloader( const RepoInfo &repoinfo ) + : repo::Downloader(repoinfo), _media_ptr(0L) { } -Downloader::Downloader(const Pathname &path ) -{ - RepoInfo info; - info.setPath(path); - _info = info; -} RepoStatus Downloader::status( MediaSetAccess &media ) { - Pathname repomd = media.provideFile( _info.path() + "/repodata/repomd.xml"); + Pathname repomd = media.provideFile( repoInfo().path() + "/repodata/repomd.xml"); return RepoStatus(repomd); } @@ -66,7 +61,7 @@ bool Downloader::patches_Callback( const OnMediaLocation &loc, const string &id ) { - OnMediaLocation loc_with_path(loc_with_path_prefix(loc, _info.path())); + OnMediaLocation loc_with_path(loc_with_path_prefix(loc, repoInfo().path())); MIL << id << " : " << loc_with_path << endl; this->enqueueDigested(loc_with_path); return true; @@ -76,7 +71,7 @@ bool Downloader::repomd_Callback( const OnMediaLocation &loc, const ResourceType &dtype ) { - OnMediaLocation loc_with_path(loc_with_path_prefix(loc, _info.path())); + OnMediaLocation loc_with_path(loc_with_path_prefix(loc, repoInfo().path())); MIL << dtype << " : " << loc_with_path << endl; //! \todo do this through a ZConfig call so that it is always in sync with parser @@ -102,7 +97,7 @@ { this->start( _dest_dir, *_media_ptr ); // now the patches.xml file must exists - PatchesFileReader( _dest_dir + _info.path() + loc.filename(), + PatchesFileReader( _dest_dir + repoInfo().path() + loc.filename(), bind( &Downloader::patches_Callback, this, _1, _2)); } @@ -113,9 +108,9 @@ const Pathname &dest_dir, const ProgressData::ReceiverFnc & progressrcv ) { - Pathname repomdpath = _info.path() + "/repodata/repomd.xml"; - Pathname keypath = _info.path() + "/repodata/repomd.xml.key"; - Pathname sigpath = _info.path() + "/repodata/repomd.xml.asc"; + Pathname repomdpath = repoInfo().path() + "/repodata/repomd.xml"; + Pathname keypath = repoInfo().path() + "/repodata/repomd.xml.key"; + Pathname sigpath = repoInfo().path() + "/repodata/repomd.xml.asc"; _media_ptr = (&media); @@ -127,23 +122,26 @@ _dest_dir = dest_dir; - SignatureFileChecker sigchecker(_info.name()); +#warning Do we need SignatureFileChecker(string descr)? + SignatureFileChecker sigchecker/*(repoInfo().name())*/; if ( _media_ptr->doesFileExist(sigpath) ) { - this->enqueue( OnMediaLocation(sigpath,1).setOptional(true) ); + this->enqueue( OnMediaLocation(sigpath,1).setOptional(true) ); this->start( dest_dir, *_media_ptr); this->reset(); - sigchecker = SignatureFileChecker(dest_dir + sigpath, _info.name()); + sigchecker = SignatureFileChecker(dest_dir + sigpath); } if ( _media_ptr->doesFileExist(keypath) ) { - this->enqueue( OnMediaLocation(keypath,1).setOptional(true) ); + KeyContext context; + context.setRepoInfo(repoInfo()); + this->enqueue( OnMediaLocation(keypath,1).setOptional(true) ); this->start( dest_dir, *_media_ptr); this->reset(); - sigchecker.addPublicKey(dest_dir + keypath); + sigchecker.addPublicKey(dest_dir + keypath, context); } @@ -152,12 +150,11 @@ if ( ! progress.tick() ) ZYPP_THROW(AbortRequestException()); - if ( ! _info.gpgCheck() ) - { - WAR << "Signature checking disabled in config of repository " << _info.alias() << endl; - } + if ( ! repoInfo().gpgCheck() ) + WAR << "Signature checking disabled in config of repository " << repoInfo().alias() << endl; + this->enqueue( OnMediaLocation(repomdpath,1), - _info.gpgCheck() ? FileChecker(sigchecker) : FileChecker(NullFileChecker()) ); + repoInfo().gpgCheck() ? FileChecker(sigchecker) : FileChecker(NullFileChecker()) ); this->start( dest_dir, *_media_ptr); if ( ! progress.tick() ) @@ -165,8 +162,8 @@ this->reset(); - Reader reader( dest_dir + _info.path() + "/repodata/repomd.xml" ); - RepomdFileReader( dest_dir + _info.path() + "/repodata/repomd.xml", bind( &Downloader::repomd_Callback, this, _1, _2)); + Reader reader( dest_dir + repoInfo().path() + "/repodata/repomd.xml" ); + RepomdFileReader( dest_dir + repoInfo().path() + "/repodata/repomd.xml", bind( &Downloader::repomd_Callback, this, _1, _2)); // ready, go! this->start( dest_dir, *_media_ptr); Modified: trunk/libzypp/zypp/repo/yum/Downloader.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/repo/yum/Downloader.... ============================================================================== --- trunk/libzypp/zypp/repo/yum/Downloader.h (original) +++ trunk/libzypp/zypp/repo/yum/Downloader.h Mon Sep 22 12:09:37 2008 @@ -40,7 +40,7 @@ */ class Downloader : public repo::Downloader { - public: + public: /** * \short Constructor from the repository information @@ -53,14 +53,6 @@ Downloader( const RepoInfo &info ); /** - * \short Constructor from the pathname relative to the - * repository url - * - * \param path Path to the repostory from the media - */ - Downloader( const Pathname &path ); - - /** * \short Download metadata to a local directory * * \param media Media access to the repository url @@ -80,7 +72,6 @@ bool repomd_Callback( const OnMediaLocation &loc, const ResourceType &dtype ); bool patches_Callback( const OnMediaLocation &loc, const std::string &id ); private: - RepoInfo _info; Pathname _dest_dir; std::list<OnMediaLocation> _patches_files; -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org