Add test to verify mar signatures
This commit is contained in:
Родитель
c451b2b78d
Коммит
5851bdf57a
|
@ -0,0 +1,9 @@
|
|||
-----BEGIN PUBLIC KEY-----
|
||||
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvH4r94FpQ0gvr1hhTfV9
|
||||
NUeWPJ5CN6TZRq7v/Dc4nkJ1J4IP1B3UEii34tcNKpy1nKupiZuTT6T1zQYT+z5x
|
||||
3UkDF9qQboQ8RNb/BEz/cN3on/LTEnZ7YSraRL11M6cEB8mvmJxddCEquwqccRbs
|
||||
Usp8WUB7uRv1w6Anley7N9F/LE1iLPwJasZypRnzWb3aYsJy0cMFOYy+OXVdpktn
|
||||
qYqlNIjnt84u4Nil6UXnBbIJNUVOCY8wOFClNvVpubjPkWK1gtdWy3x/hJU5RpAO
|
||||
K9cnHxq4M/I4SUWTWO3r7yweQiHG4Jyoc7sP1jkwjBkSG93sDEycfwOdOoZft3wN
|
||||
sQIDAQAB
|
||||
-----END PUBLIC KEY-----
|
|
@ -0,0 +1,19 @@
|
|||
from unittest import TestCase
|
||||
import os
|
||||
|
||||
from mardor.marfile import MarFile
|
||||
|
||||
TEST_MAR = os.path.join(os.path.dirname(__file__), 'test.mar')
|
||||
|
||||
# This was extracted via:
|
||||
# curl
|
||||
# https://hg.mozilla.org/mozilla-central/raw-file/58e4264903ba/toolkit/mozapps/update/updater/release_primary.der
|
||||
# | openssl x509 -inform DER -pubkey -noout
|
||||
TEST_KEY = os.path.join(os.path.dirname(__file__), 'test.pubkey')
|
||||
|
||||
|
||||
class TestMarSignatures(TestCase):
|
||||
def test_verify(self):
|
||||
"""Check that our test mar is signed correctly"""
|
||||
marfile = MarFile(TEST_MAR, signature_versions=[(1, TEST_KEY)])
|
||||
marfile.verify_signatures()
|
1
tox.ini
1
tox.ini
|
@ -8,6 +8,7 @@ setenv =
|
|||
deps =
|
||||
nose
|
||||
coverage
|
||||
cryptography
|
||||
|
||||
commands =
|
||||
coverage run -a --branch --source=mardor {envbindir}/nosetests
|
||||
|
|
Загрузка…
Ссылка в новой задаче