binaryanalysis-ng
binaryanalysis-ng copied to clipboard
cacert certificate rejected by unpackCertificate
The archive at https://archive.synology.com/download/DSM/release/6.2.1/23824/DSM_DS112+_23824.pat contains a certificate file that is unpacked to
unpack/DSM_DS112+_23824.pat-tar-1/hda1.tgz-xz-1/unpacked-from-xz-tar-1/usr/lib/python2.7/ensurepip/_bundled/pip-8.1.1-py2.py3-none-any.whl-zip-1/pip/_vendor/requests/cacert.pem
unpackCertificate rejects this file and says that it is not a certificate.
The error is when unpacking by extension:
FAIL DSM_DS112+_23824.pat-tar-1/hda1.tgz-xz-1/unpacked-from-xz-tar-1/usr/lib/python2.7/ensurepip/_bundled/pip-8.1.1-py2.py3-none-any.whl-zip-1/pip/_vendor/requests/cacert.pem known extension .pem: not a valid certificate (no begin)
At the same time, it extracts 166 certificates from this file, which are the certificates in this file.
The two possibilities that are tried both give errors:
$ openssl asn1parse -inform DER -in cacert.pem
0:d=0 hl=2 l= 35 prim: ENUMERATED :204973737565723A204F3D45717569666178204F553D45717569666178205365637572
37:d=0 hl=2 l= 32 cons: appl [ 5 ]
Error in encoding
139851339802432:error:0D07209B:asn1 encoding routines:ASN1_get_object:too long:crypto/asn1/asn1_lib.c:91:
$ openssl asn1parse -inform PEM -in cacert.pem Error: offset out of range
meaning that likely another command needs to be used for it instead of asn1parse.