Giter Club home page Giter Club logo

Comments (2)

kazuho avatar kazuho commented on September 8, 2024

I believe that the particular version of OpenSSL you are using is prepending 00 when the most-significant bit of the private key is set, as you need to do for ASN.1.

Interestingly, whether if such padding is made seems to depend on the version of the OpenSSL; as shown below, OpenSSL 1.1.0 does not prepend 00 to the output.

$ /usr/local/openssl-1.0.2/bin/openssl ec -in key.pem -text
read EC key
Private-Key: (256 bit)
priv:
    00:fe:44:a5:6f:e8:18:a6:b6:28:6a:5a:e1:a6:86:
    3c:02:4e:42:50:77:90:4e:d2:dc:89:99:c5:24:2e:
    a3:9e:77
pub: 
(snip)
$ /usr/local/openssl-1.1.0/bin/openssl ec -in key.pem -text
read EC key
Private-Key: (256 bit)
priv:
    fe:44:a5:6f:e8:18:a6:b6:28:6a:5a:e1:a6:86:3c:
    02:4e:42:50:77:90:4e:d2:dc:89:99:c5:24:2e:a3:
    9e:77
pub:
(snip)

Considering the facts, I'd suggest removing the first byte on the script side if the length of the private key is 1 byte longer than expected and if the first byte is 00.

from picotls.

larseggert avatar larseggert commented on September 8, 2024

Thanks! I fixed this in NTAP/quant@dc414c9

from picotls.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.