X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=pygost%2Ftest_pfx.py;h=6f066431eda3f5e32a244ebded8132ea060be82c;hb=03de94212cd7c039e6a7f4f947fbd2d7d6c9b70e;hp=831dd4734247ae8d19a07133854a456e614acc8f;hpb=0fcc8bc147ada51d2a9a912f18ac362d54b7d49a;p=pygost.git diff --git a/pygost/test_pfx.py b/pygost/test_pfx.py index 831dd47..6f06643 100644 --- a/pygost/test_pfx.py +++ b/pygost/test_pfx.py @@ -1,11 +1,10 @@ # coding: utf-8 # PyGOST -- Pure Python GOST cryptographic functions library -# Copyright (C) 2015-2019 Sergey Matveev +# Copyright (C) 2015-2020 Sergey Matveev # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. +# the Free Software Foundation, version 3 of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -23,7 +22,6 @@ from unittest import TestCase from pygost.gost28147 import cfb_decrypt from pygost.gost34112012512 import GOST34112012512 from pygost.gost34112012512 import pbkdf2 as gost34112012_pbkdf2 -from pygost.utils import hexdec try: @@ -74,7 +72,7 @@ AwcBAQIDBEAIFX0fyZe20QKKhWm6WYX+S92Gt6zaXroXOvAmayzLfZ5Sd9C2t9zZ JSg6M8RBUYpw/8ym5ou1o2nDa09M5zF3BCCpzyCQBI+rzfISeKvPV1ROfcXiYU93 mwcl1xQV2G5/fgICB9A= """) - password = u'Пароль для PFX' + password = u"Пароль для PFX" def test_shrouded_key_bag(self): private_key_info_expected = b64decode(b""" @@ -164,7 +162,7 @@ ATAMBggqhQMHAQEDAgUAA0EA9oq0Vvk8kkgIwkp0x0J5eKtia4MNTiwKAm7jgnCZIx3O98BThaTX _, outer_safe_contents = pfx["authSafe"]["content"].defined mac_data = pfx["macData"] mac_key = gost34112012_pbkdf2( - password=self.password.encode('utf-8'), + password=self.password.encode("utf-8"), salt=bytes(mac_data["macSalt"]), iterations=int(mac_data["iterations"]), dklen=96,