From c8d5fd6fd742ffabc7e4c013ea8b2ef14e1e387a Mon Sep 17 00:00:00 2001 From: Michael Andres Date: Thu, 5 Sep 2013 15:32:34 +0200 Subject: [PATCH] Avoid parsing gpg subkeys but still parse multiple keys --- tests/zypp/PublicKey_test.cc | 3 + tests/zypp/data/PublicKey/multikey2.asc | 214 ++++++++++++++++++++++++++++++++ zypp/PublicKey.cc | 54 +++++--- 3 files changed, 251 insertions(+), 20 deletions(-) create mode 100644 tests/zypp/data/PublicKey/multikey2.asc diff --git a/tests/zypp/PublicKey_test.cc b/tests/zypp/PublicKey_test.cc index 6305297..98c8b2d 100644 --- a/tests/zypp/PublicKey_test.cc +++ b/tests/zypp/PublicKey_test.cc @@ -48,5 +48,8 @@ BOOST_AUTO_TEST_CASE(publickey_test) BOOST_CHECK_EQUAL( k2.gpgPubkeyRelease(), "4be01af3" ); BOOST_CHECK_EQUAL( k2.created(), zypp::Date(1272978163) ); BOOST_CHECK_EQUAL( k2.expires(), zypp::Date(1399122163) ); + + k2 = zypp::PublicKey(DATADIR/"multikey2.asc"); + BOOST_CHECK_EQUAL( k2.hiddenKeys().size(), 8 ); } diff --git a/tests/zypp/data/PublicKey/multikey2.asc b/tests/zypp/data/PublicKey/multikey2.asc new file mode 100644 index 0000000..1ee7f92 --- /dev/null +++ b/tests/zypp/data/PublicKey/multikey2.asc @@ -0,0 +1,214 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v1.4.6 (GNU/Linux) + +mQGiBDsj/RYRBACQD/DCxkMgmEjBNYh53AfsV+zcMaz4nDmeEElANfHrVzVGx33N +Siiqs33RIjV35Gd8OH1iSnbA7ef0gWELgVSToK2ydv/3X5Cbcb1MOWYQKJE1dQz7 +fw7Ic9nP7NieM18YMsOYEmCvyL4sLZviQIlb3caP+OpI/GAoNINY8m9yowCgxgx1 +L+jnJznXyKy7v5WgwMyrE2cD/38Nvp62Rq1/IqhUDc3SDUp5+xPddwOZ/E7P9F73 +0Gb2ec2fhAm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FrG7kg8AYT+0k+kTS/UydwAr57QSLUc +/blXR6seNd+TM4Kwj4Ij2pNL/LpZyzVrDS9BWNZHq3bQnERPrfXpK5XWX0quZn8z +g1ImFwxmJduHKmtyyxNjjPR1SUFzD1EXpPfCYgRL6kU4OflbgGoL2YpmgHO6LQ/O +GrQyb3BlblNVU0UgQnVpbGQgU2VydmljZSA8YnVpbGRzZXJ2aWNlQG9wZW5zdXNl +Lm9yZz6IZAQTEQIAJAUCRHRQtwIbAwUJA8JnAAYLCQgHAwIDFQIDAxYCAQIeAQIX +gAAKCRA7MBG3a51lI/ewAJkB4psDm44RckrzyMyjXEKBYXYKXQCcCLBW95t7ooAI +yqfsg94RICpbr50= +=NAat +-----END PGP PUBLIC KEY BLOCK----- diff --git a/zypp/PublicKey.cc b/zypp/PublicKey.cc index 6bfa587..264aa50 100644 --- a/zypp/PublicKey.cc +++ b/zypp/PublicKey.cc @@ -170,11 +170,13 @@ namespace zypp /////////////////////////////////////////////////////////////////// struct PublicKeyScanner::Impl { - std::vector _words; - enum { pNONE, pPUB, pSIG, pFPR, pUID, pSUB } _parseEntry; + std::vector _words; + enum { pNONE, pPUB, pSIG, pFPR, pUID } _parseEntry; + bool _parseOff; // no 'sub:' key parsing Impl() : _parseEntry( pNONE ) + , _parseOff( false ) {} void scan( std::string & line_r, std::list & keys_r ) @@ -187,29 +189,43 @@ namespace zypp // sig:::17:A84EDAE89C800ACA:1318348291:::::[selfsig]::13x: // sub:-:2048:16:197448E88495160C:971961490:1214043258::: [expires: 2008-06-21] // sig:::17:A84EDAE89C800ACA:1087899258:::::[keybind]::18x: - if ( _parseEntry == pSUB ) - return; // don't parse in subkeys - if ( line_r.empty() ) return; - // quick check for interesting entries + // quick check for interesting entries, no parsing in subkeys _parseEntry = pNONE; switch ( line_r[0] ) { - #define DOTEST( C1, C2, C3, E ) case C1: if ( line_r[1] == C2 && line_r[2] == C3 && line_r[3] == ':' ) _parseEntry = E; break - DOTEST( 'p', 'u', 'b', pPUB ); - DOTEST( 's', 'i', 'g', pSIG ); - DOTEST( 'f', 'p', 'r', pFPR ); - DOTEST( 'u', 'i', 'd', pUID ); - #undef DOTEST + case 'p': + if ( line_r[1] == 'u' && line_r[2] == 'b' && line_r[3] == ':' ) + { + _parseEntry = pPUB; + _parseOff = false; + } + break; + + case 'f': + if ( line_r[1] == 'p' && line_r[2] == 'r' && line_r[3] == ':' ) + _parseEntry = pFPR; + break; + + case 'u': + if ( line_r[1] == 'i' && line_r[2] == 'd' && line_r[3] == ':' ) + _parseEntry = pUID; + break; + + case 's': + if ( line_r[1] == 'i' && line_r[2] == 'g' && line_r[3] == ':' ) + _parseEntry = pSIG; + else if ( line_r[1] == 'u' && line_r[2] == 'b' && line_r[3] == ':' ) + _parseOff = true; + break; + + default: + return; } - if ( _parseEntry == pNONE ) - { - if ( line_r[0] == 's' && line_r[1] == 'u' && line_r[2] == 'b' && line_r[3] == ':' ) - _parseEntry = pSUB; + if ( _parseOff || _parseEntry == pNONE ) return; - } if ( line_r[line_r.size()-1] == '\n' ) line_r.erase( line_r.size()-1 ); @@ -252,7 +268,6 @@ namespace zypp break; case pNONE: - case pSUB: break; // intentionally no default: } } @@ -343,8 +358,7 @@ namespace zypp "--no-tty", "--no-greeting", "--batch", - "--status-fd", - "1", + "--status-fd", "1", _dataFile.path().asString().c_str(), NULL }; -- 2.7.4