Author: dmacvicar Date: Tue Aug 28 12:44:03 2007 New Revision: 6920 URL: http://svn.opensuse.org/viewcvs/zypp?rev=6920&view=rev Log: - real fix for bug #390535 Modified: trunk/libzypp/tests/zypp/KeyRing.cc trunk/libzypp/zypp/KeyRing.cc Modified: trunk/libzypp/tests/zypp/KeyRing.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/tests/zypp/KeyRing.cc?rev=6920&r1=6919&r2=6920&view=diff ============================================================================== --- trunk/libzypp/tests/zypp/KeyRing.cc (original) +++ trunk/libzypp/tests/zypp/KeyRing.cc Tue Aug 28 12:44:03 2007 @@ -193,6 +193,13 @@ //BOOST_CHECK_EQUAL( keyring.trustedPublicKeys().size(), 1 ); /* check signature id can be extracted */ + +} + +void keyring_signature_test( const string &dir ) +{ + PublicKey key( Pathname(dir) + "public.asc" ); + { KeyRingTestReceiver keyring_callbacks; KeyRingTestSignalReceiver receiver; @@ -204,6 +211,11 @@ BOOST_CHECK_THROW( keyring.readSignatureKeyId(Pathname()), Exception ); TmpFile tmp; BOOST_CHECK_EQUAL( keyring.readSignatureKeyId(tmp.path()), "" ); + + keyring.importKey(key); + + BOOST_CHECK(keyring.verifyFileSignature( Pathname(dir) + "repomd.xml", Pathname(dir) + "repomd.xml.asc")); + BOOST_CHECK( ! keyring.verifyFileSignature( Pathname(dir) + "repomd.xml.corrupted", Pathname(dir) + "repomd.xml.asc")); } } @@ -229,6 +241,8 @@ test_suite* test= BOOST_TEST_SUITE( "PublicKeyTest" ); test->add(BOOST_PARAM_TEST_CASE( &keyring_test, (std::string const*)params, params+1)); + test->add(BOOST_PARAM_TEST_CASE( &keyring_signature_test, + (std::string const*)params, params+1)); return test; } Modified: trunk/libzypp/zypp/KeyRing.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/KeyRing.cc?rev=6920&r1=6919&r2=6920&view=diff ============================================================================== --- trunk/libzypp/zypp/KeyRing.cc (original) +++ trunk/libzypp/zypp/KeyRing.cc Tue Aug 28 12:44:03 2007 @@ -540,7 +540,6 @@ MIL << "Determining key id if signature " << signature << endl; // HACK create a tmp keyring with no keys TmpDir dir(_base_dir, "fake-keyring"); - TmpFile fakeData(_base_dir, "fake-data"); const char* argv[] = { @@ -554,9 +553,7 @@ "1", "--homedir", dir.path().asString().c_str(), - "--verify", signature.asString().c_str(), - fakeData.path().asString().c_str(), NULL }; -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org