author | Bryce Seager van Dyk <bvandyk@mozilla.com> |
Tue, 19 Oct 2021 15:06:58 +0000 | |
changeset 596363 | 3f145a672ed6f752054d408fa32f6c781aaec6f1 |
parent 596362 | 46ed5b6367a142a6a3fdc56e53ff32fbb234522c |
child 596364 | 5243c0c312339bb42709453c8b27afbfeef56795 |
push id | 38896 |
push user | abutkovits@mozilla.com |
push date | Tue, 19 Oct 2021 21:51:00 +0000 |
treeherder | mozilla-central@e9071741b84c [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | keeler |
bugs | 1736453 |
milestone | 95.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
security/manager/ssl/tests/unit/test_content_signing/pysign.py | file | annotate | diff | comparison | revisions |
--- a/security/manager/ssl/tests/unit/test_content_signing/pysign.py +++ b/security/manager/ssl/tests/unit/test_content_signing/pysign.py @@ -13,23 +13,24 @@ The certificates for the content signatu You can use pysign.py like this: cat test.txt | python pysign.py > test.txt.signature """ import base64 import binascii import hashlib -import os +import pathlib import six import sys import ecdsa -# For pykey -sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) +# For pykey, find the relative file location and add it to path +toolsDir = (pathlib.Path(__file__).parents[4] / "tools").resolve() +sys.path.append(str(toolsDir)) import pykey data = sys.stdin.buffer.read() key = pykey.ECCKey("secp384r1") sig = key.signRaw(b"Content-Signature:\00" + data, pykey.HASH_SHA384) -print base64.b64encode(sig).replace("+", "-").replace("/", "_") +print(str(base64.b64encode(sig)).replace("+", "-").replace("/", "_"))