Closed oditorium closed 5 years ago
Hello,
thanks for the library -- it is very helpful. Having said this -- I am trying to reconcile it against OpenSSL and I am finding this hard.
One issue seems to be that the PEM import is broken. See the Azure Notebook here https://ecdsa-skloesch.notebooks.azure.com/j/notebooks/FastECDSA.ipynb
In brief, the issue is the following:
This code works
keypem = """-----BEGIN EC PRIVATE KEY----- MHQCAQEEIDAH346L7Ww1kqEPnQSVFz3Oy8maQOjIi0fX1ZD4tgjdoAcGBSuBBAAK oUQDQgAELAcTVHlPOP9Dnv9S+LR1sN7zSiEKo7iKY/KnKV019B+w811PRdlWV/o3 1qVDG+lEGpVjj8cQiE9D//eThCgFbg== -----END EC PRIVATE KEY-----""" key, pubkey = fe_pem.PEMEncoder.decode_private_key(keypem) print(keypem) print(fe_keys.export_key(key, curve=CURVE))
This code works but gives a different result (only difference: newlines in the certificate file)
keypem = """ -----BEGIN EC PRIVATE KEY----- MHQCAQEEIDAH346L7Ww1kqEPnQSVFz3Oy8maQOjIi0fX1ZD4tgjdoAcGBSuBBAAK oUQDQgAELAcTVHlPOP9Dnv9S+LR1sN7zSiEKo7iKY/KnKV019B+w811PRdlWV/o3 1qVDG+lEGpVjj8cQiE9D//eThCgFbg== -----END EC PRIVATE KEY----- """ key, pubkey = fe_pem.PEMEncoder.decode_private_key(keypem) print(keypem) print(fe_keys.export_key(key, curve=CURVE))
And finally, this code breaks (multiple new lines)
Thanks for catching this, verified that this is an issue and tested fix against provided inputs. Fixed in ce41af6223ec80d3384b26c0c1ee84deba21f786 and released in 6e4648105602add712c3cd3682835de3ffda7c75.
thanks
Hello,
thanks for the library -- it is very helpful. Having said this -- I am trying to reconcile it against OpenSSL and I am finding this hard.
One issue seems to be that the PEM import is broken. See the Azure Notebook here https://ecdsa-skloesch.notebooks.azure.com/j/notebooks/FastECDSA.ipynb
In brief, the issue is the following:
This code works
This code works but gives a different result (only difference: newlines in the certificate file)
And finally, this code breaks (multiple new lines)