Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pyderasn.DecodeError: CPBlob remaining data #2

Closed
OstapW opened this issue Aug 15, 2023 · 4 comments
Closed

pyderasn.DecodeError: CPBlob remaining data #2

OstapW opened this issue Aug 15, 2023 · 4 comments
Labels
bug Something isn't working fixed Something was fixed

Comments

@OstapW
Copy link

OstapW commented Aug 15, 2023

При попытке выполнить декодировку pfx для эцп выпущенного тестовым УЦ КриптоПро падает с ошибкой:

CryptoPro PFX Decoder by li0ard
Введите пароль:
SALT = 52259485af47d3c358c7ba66a74c37ed
ITERS = 2000
Прогресс: |**************************************************| 100.0% Завершено
KEY = 27458cabecb90b08177d58b85b157ffe2b2ae8829dc3260590ebbecb633dbc7f
IV = 52259485af47d3c3
Traceback (most recent call last):
File "cpfx.py", line 91, in
result = CPBlob().decode(result)[0]
File "/usr/local/lib/python3.8/dist-packages/pyderasn-9.3-py3.8.egg/pyderasn.py", line 1922, in decode
File "/usr/local/lib/python3.8/dist-packages/pyderasn-9.3-py3.8.egg/pyderasn.py", line 1966, in decode_evgen
File "/usr/local/lib/python3.8/dist-packages/pyderasn-9.3-py3.8.egg/pyderasn.py", line 6609, in _decode
pyderasn.DecodeError: CPBlob remaining data

Файл приложил.
gost.pfx.zip

@li0ard
Copy link
Owner

li0ard commented Aug 16, 2023

А пробовали в СКЗИ сначала импортировать, а потом попробовать экспортировать и уже этот PFX прогнать через прогу? Просто если так уже не прокатит значит КриптоПро опять что то намутил с форматом

@OstapW
Copy link
Author

OstapW commented Aug 16, 2023

Это pfx эскпортированный из КриптоПро CryptCP 5.0

@li0ard
Copy link
Owner

li0ard commented Oct 7, 2023

А вот в чём собственно была проблема. КриптоПро добавил Attributes с OID 1.2.643.2.2.37.3.10 (aka szOID_CryptoPro_private_keys_extension_container_exchange_key_usage_period) в связи с чем библиотека PyDERASN видела лишнее поле (не описанное в схеме) и писала об этом

image

li0ard added a commit that referenced this issue Oct 7, 2023
@li0ard li0ard added the bug Something isn't working label Oct 7, 2023
@li0ard
Copy link
Owner

li0ard commented Oct 7, 2023

Исправлено

@li0ard li0ard closed this as completed Oct 7, 2023
@li0ard li0ard added the fixed Something was fixed label Oct 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed Something was fixed
Projects
None yet
Development

No branches or pull requests

2 participants