Skip to content

Commit

Permalink
Merge pull request #780 from aptly-dev/773-non-armored-sig
Browse files Browse the repository at this point in the history
Support for non-armored detached signatures
  • Loading branch information
smira authored Sep 26, 2018
2 parents 2b4a61b + 9f7c1f9 commit ec57d17
Show file tree
Hide file tree
Showing 5 changed files with 118 additions and 1 deletion.
Binary file added pgp/4.signature
Binary file not shown.
109 changes: 109 additions & 0 deletions pgp/4.text
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
Origin: Canonical
Suite: xenial-updates
Codename: xenial-updates/newton
Date: Tue, 25 Sep 2018 21:45:15 UTC
Architectures: i386 amd64 armhf ppc64el arm64 s390x
Components: main
Description: OpenStack Newton archive for Ubuntu 16.04 LTS
MD5Sum:
ed32606ac5a1ce86befae2715ebd5328 559539 main/binary-i386/Packages
100b57acc19e7fc74994fa7f843a3fe6 120571 main/binary-i386/Packages.gz
30687c5e34fd9eac9feb3e0ba4a0f94b 136 main/binary-i386/Release
24e1b1243547d40ada70bb45343f4a56 560520 main/binary-amd64/Packages
52aa3aab02dbf701572e02a43f0140b3 120716 main/binary-amd64/Packages.gz
beca9426b77f6322e4b9793b30f42183 137 main/binary-amd64/Release
3fca39e42300b53d02e7453e4fed96a2 497267 main/binary-armhf/Packages
8bf44c480558f5e922263cbc2c1394a5 108076 main/binary-armhf/Packages.gz
5c38f748178697764f9724828f0151ab 137 main/binary-armhf/Release
51cdb3afb5b2fcb5fc7f6fce22085628 516159 main/binary-ppc64el/Packages
8d3bd39c70b096496d7d01ba9a525851 112620 main/binary-ppc64el/Packages.gz
51dda1f860edc7975a3852e7c4f9f69d 139 main/binary-ppc64el/Release
23471ddea998006fbf82825dc2d22f4e 557502 main/binary-arm64/Packages
52d0175877152059aeec77114265df7e 120123 main/binary-arm64/Packages.gz
6a909d0126b1e910fcd2b3f58d53ef7b 137 main/binary-arm64/Release
89171df2220477022ef91e74c236d74d 516061 main/binary-s390x/Packages
bbfea425a605c53e59c440adc7d491c0 112610 main/binary-s390x/Packages.gz
eaa188bf3d6e821f73b7c29f9085973f 137 main/binary-s390x/Release
9b21f7c2c0d89f08cd54d21526b2b7f7 417889 main/source/Sources
8113c5d6484daf4f632cacd048aa81a7 81794 main/source/Sources.gz
36c2b37c73e51cb58ec2769baaa237f2 138 main/source/Release
cce4a93beb7346dfcfc401343c1a07e7 5194695 Contents-i386
099e00a2232232f0b891ab2924796cd4 321384 Contents-i386.gz
148c884428ab15f5c16d4a8df0358f41 5195719 Contents-amd64
b7e9f1fad4d5e63f9ccaaf826dba4af5 321473 Contents-amd64.gz
82f8be9e623dc1ac2191f04db01b2080 5121293 Contents-armhf
933cb600a7d31d87ee2f862464ca0a71 313824 Contents-armhf.gz
5d5dc264638d1b585499267e07793d57 5157787 Contents-ppc64el
da5b35ec8d94e9f7db3d6a76f36fa099 317603 Contents-ppc64el.gz
7d2ad5ec50c13c92d7690567b3fc674a 5194665 Contents-arm64
bf3c7c2cd0d8ae68b670e85bf4c0a55f 321315 Contents-arm64.gz
6fe4eb1eb6bc4ea36f393b43b30957d4 5157667 Contents-s390x
c69b1e4ca2d8ef58355f422bf282c173 317598 Contents-s390x.gz
SHA1:
7830f7d6f20f591dd8d268a4be4c7683c9fcbaf1 559539 main/binary-i386/Packages
eafced4e96ccf644cde26a7e16606c3f4079e252 120571 main/binary-i386/Packages.gz
9aee52218b3cfa1df5f326ed2c2e562de255cb68 136 main/binary-i386/Release
a2ec30f4af65fffc8e3c57e0b3aa7771c2148f7b 560520 main/binary-amd64/Packages
2d6afc82b4afe15a72e7bc79ff8b4096ea7f852d 120716 main/binary-amd64/Packages.gz
b8ee5a9cc3b3b73cd0844591eb7108d233e67991 137 main/binary-amd64/Release
37edbb5717e48dd5ef4410e2cdaafad010dfb3f5 497267 main/binary-armhf/Packages
166cc92eba00d6c7e8a73869fb0b4682ed401402 108076 main/binary-armhf/Packages.gz
1e9009c47ba57153c77b58dc85fa80c6b7736c71 137 main/binary-armhf/Release
3fed2e76b941dcc7177f858794ef5c26e6054ae5 516159 main/binary-ppc64el/Packages
9b447bdbe3c8872a85e79c42cedd367dd78c1c22 112620 main/binary-ppc64el/Packages.gz
2ff8e4116672ef13f0488240ffbe9893ef72d251 139 main/binary-ppc64el/Release
175b7d0f77ec52b43769133f8a7c2568c573604a 557502 main/binary-arm64/Packages
31dbc9776ec0f09902e403ab397e23abf8a27c6f 120123 main/binary-arm64/Packages.gz
1d86c1ffd8bbaff5da76f9fd6e66df0b09885f69 137 main/binary-arm64/Release
b66894b8555a564d48808c757069d89d5e25749f 516061 main/binary-s390x/Packages
d76c22241faada5571975f3d7c1689e35456d1fd 112610 main/binary-s390x/Packages.gz
927c8b132b4f41440c3342ff6dafa889b8debbf1 137 main/binary-s390x/Release
0fa2981518816d511b8719c3ee28d309480cc97e 417889 main/source/Sources
1de78aa62f50854c87b1ea56ee0fd1dd0485f9d7 81794 main/source/Sources.gz
8dcbec8bfd3a98b8d9106f0a86e8583403d78458 138 main/source/Release
de31496319ebb8a06e843e2a855323ee996b11a8 5194695 Contents-i386
a85e1fb48738be3702bb2e0a7bfaec5ddda4a36e 321384 Contents-i386.gz
4af01067070fe5206a5212a482ed221c0ab58553 5195719 Contents-amd64
fac22f57752875f95dce9ae9bce4f5919732b522 321473 Contents-amd64.gz
7408f28ea1e5ef995b5545a9c5d31f5a06f1deed 5121293 Contents-armhf
dfdf1eee9652d079d7f00d102c6a9d69f76d2134 313824 Contents-armhf.gz
c348534f065afc7bf171eeb64da87417fb8ff3b1 5157787 Contents-ppc64el
a843a8b2f7a7c453c1c8aaa349bf5f95c4391692 317603 Contents-ppc64el.gz
ac080e8fb26c2726ce14b2b89e847c3a46953276 5194665 Contents-arm64
0d94c3e512eb46891799a922f4db41dbd8f7a677 321315 Contents-arm64.gz
5dbb522f499ee5d316346cf135e1d0eaba0a8ee2 5157667 Contents-s390x
1039320511a46c2232b53113c88eb47f19fc49db 317598 Contents-s390x.gz
SHA256:
2ae20b2535fdb2a8f2e4b51a139c45ad5effc1601db5910074030d1b240bf6d8 559539 main/binary-i386/Packages
e297fe58c023868db53045d3743c879189d31bf756320bedbe9aeed46d2a9b18 120571 main/binary-i386/Packages.gz
d225d69dc14ad076639111f91c52d2a3dd69bb1a92c3bedc60c82486f6199634 136 main/binary-i386/Release
1a00ac12805e0def30228d5483373e24ffe1b5b77543624c75652ebeb25f9945 560520 main/binary-amd64/Packages
a622da857847f178dc554909597c522f5cdd7f953f2067a1493a806f3e43b134 120716 main/binary-amd64/Packages.gz
cd1a07c3615a54e20f47d7ccd8e73ceaa5a371571a699dd5e8ae11d9066f9929 137 main/binary-amd64/Release
25be54171d77d9732aa234ed1505f82fce44ab90fc223440708f6e86696d8a45 497267 main/binary-armhf/Packages
9dc79733217cbf28b9b92684c9d37ca5011fae6b20fddc67b2117d7551915faa 108076 main/binary-armhf/Packages.gz
d86d50eb4a75ce2817ce5a6a7d792e822e105a139c5fb279fbfadfd96c9d9fc1 137 main/binary-armhf/Release
e5c488274bb806394f0a4a253a41609cfd888754e1dbc184e308fd8f56d50795 516159 main/binary-ppc64el/Packages
4001d9cf9223c876a31cf8d7adc0c1144630a82d1e65e595cdd5bca9222559dd 112620 main/binary-ppc64el/Packages.gz
5b2da9b67840f666a54164f2a6e8333e5977ddc362af188bda5e99eb96bb3fde 139 main/binary-ppc64el/Release
332d7c702c4ef4b3aa8178852945383829db6cdfa4d7c5b4bebea3016244ce10 557502 main/binary-arm64/Packages
cc25d0fc96f92d894ed765bf4ec25330c88b3d1f4395c107dfa720bf719a5f2b 120123 main/binary-arm64/Packages.gz
3deb687a4f3c3ac0a24733e90578c0bcfb4f3cd5e692dce0c5d293d76bca073c 137 main/binary-arm64/Release
cb01f4e6501350005260311d818444df6a8c8c76ef29d145b2bf7031fa808f1c 516061 main/binary-s390x/Packages
95f7f94b492c83992efad814ea228c9cdd1b04347b4118532f0dd1b83cf66351 112610 main/binary-s390x/Packages.gz
154ed5c2c7356d6ae63340ed5e8f73806f82af958510084ccb3e36c19fc39d0b 137 main/binary-s390x/Release
68b03eed15470eaf8df0702abe623a6ec055a117851050eec50a203d44f6ff25 417889 main/source/Sources
770e405fb223116b02a5b71df93b55db037703126044b45338b8d03c2ab5f9e6 81794 main/source/Sources.gz
32aa4fbf5c619b3491df7dbfc98a752cf8235d770775c9207ebb6bfa0b236c16 138 main/source/Release
f03799e6858a078dafaab8740acafc9184b7d1a070ec94ff2c0589771175a2bb 5194695 Contents-i386
4e546e8e37208d2433dfcdfe8de707bb8062ddb0b80e92696d43169f81bb326d 321384 Contents-i386.gz
5d155efdccd8258b493f039bf55d038630465bf064301e115198dcae52dd6065 5195719 Contents-amd64
c66c2b872aca23d1595902b1091d697e7d116d9580d5e255838e99a439789845 321473 Contents-amd64.gz
cc60e26e7fd2c2f9efc2060ce981b02a396941b5d028629a1d4ea85f768bb59d 5121293 Contents-armhf
6f5a036d3f471bc9f9912ae2531641d69464174565eb7be0661eccf5cb023762 313824 Contents-armhf.gz
d0c9b1ce2d5e0dbc3f83bf63edb8369d6c6958fd653999a00064ce7aa387540a 5157787 Contents-ppc64el
235241b688107b2b40c55dbb883e051754bffaaa7eaccf9da762ffa6da429570 317603 Contents-ppc64el.gz
74f39e2423ce5bb033b824e4e3b642ac19db472d5cc2a8faa4dad49932b97211 5194665 Contents-arm64
3829445563cd1b75f79dd86756437efe7a6eb0a2601e9e423faf7bb8e9ad2aa7 321315 Contents-arm64.gz
6280906ac14ccc3e9947e018a3296bfa1e4081df75a4fe2a78f92bb93418d706 5157667 Contents-s390x
86180bba76cdbebe566f0075680a99b4e19c4308e302e16d5d95a2008b255d17 317598 Contents-s390x.gz
9 changes: 8 additions & 1 deletion pgp/internal.go
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,14 @@ func (g *GoVerifier) printLog(signers []signatureResult) {

// VerifyDetachedSignature verifies combination of signature and cleartext using gpgv
func (g *GoVerifier) VerifyDetachedSignature(signature, cleartext io.Reader, showKeyTip bool) error {
signers, missingKeys, err := checkArmoredDetachedSignature(g.trustedKeyring, cleartext, signature)
var signatureBuf bytes.Buffer

signers, missingKeys, err := checkArmoredDetachedSignature(g.trustedKeyring, cleartext, io.TeeReader(signature, &signatureBuf))

if err == io.EOF {
// most probably not armored signature
signers, missingKeys, err = checkDetachedSignature(g.trustedKeyring, cleartext, &signatureBuf)
}

g.printLog(signers)

Expand Down
Binary file modified pgp/trusted.gpg
Binary file not shown.
1 change: 1 addition & 0 deletions pgp/verify_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ func (s *VerifierSuite) TestVerifyDetached(c *C) {
{"1.text", "1.signature"},
{"2.text", "2.signature"},
{"3.text", "3.signature"},
{"4.text", "4.signature"},
} {
cleartext, err := os.Open(test.textName)
c.Assert(err, IsNil)
Expand Down

0 comments on commit ec57d17

Please sign in to comment.