anvilresearch / webcrypto

W3C Web Cryptography API for Node.js
MIT License
82 stars 14 forks source link

ECDSA signature validation issues? #74

Open apowers313 opened 6 years ago

apowers313 commented 6 years ago

I was trying to use @trust/webcrypto as a polyfill for pki.js so that I could use it as a replacement to node-webcrypto-ossl but ran into problems while trying to perform ECDSA validation. The author of pki.js found similar problems when running the CTjs tests.

Full thread and some potential test data can be found at PeculiarVentures/PKI.js#178

dmitrizagidulin commented 6 years ago

Thanks @apowers313! We'll look into it.

apowers313 commented 6 years ago

Thanks. And nice to see a familiar face. :)

amark commented 6 years ago

@dmitrizagidulin @christiansmith (long time no chat!) we are having the same problem, signatures from Browser native WebCrypto with ECDSA SHA-256 / P-256 do not properly verify in NodeJS using @trust/webcrypto and we have to use node-webcrypto-ossl instead.

Compatibility table says partial support for these signatures should pass. So you guys seemed to have it working at some point? How soon can this be fixed? We don't need any other algo/curves and would rather not have to install Python for ossl to work.

rmhrisk commented 5 years ago

As a FYI, we have created a purse TS Webcrypto polyfill also - https://github.com/PeculiarVentures/webcrypto this removes the C++ build-time dependencies. It is not full featured enough to replace our current node-webcrypto-ossl for all use cases due to dependency limitations with this approach but it may be useful for those who are encountering the problem discussed here in this bug.