Giter Site home page Giter Site logo

Comments (10)

kazuho avatar kazuho commented on August 29, 2024

Thank you for reporting the issue.

Neverbleed is implemented as an offloading engine for RSA operations.

Are you suggesting to add(or interested in adding) an ECDSA engine? Or is your suggestion to improve the error message?

from neverbleed.

tatsuhiro-t avatar tatsuhiro-t commented on August 29, 2024

I overlooked RSA designation of neverbleed, but I think it would be great to add ECDSA support to neverbleed, since otherwise we first detect whether the given certificate is ECDSA or not to decide to use neverbleed.

from neverbleed.

kazuho avatar kazuho commented on August 29, 2024

I think it would be great to add ECDSA support to neverbleed

Agreed.

therwise we first detect whether the given certificate is ECDSA or not to decide to use neverbleed.

For the meantime, I believe you can easily check if your app is going to load a RSA private key by examining the X509* structure of the certificate. The code will look like:

X509 *cert = ...; // load certificate using PEM_load_X509, etc.
EVP_PKEY *pkey = X509_get_X509_PUBKEY(cert);
if (pkey != NULL && EVP_PKEY_type(pkey->type) == EVP_PKEY_RSA) {
  // the public key in the certificate is RSA
} else {
  // the public key is not RSA
}

from neverbleed.

tatsuhiro-t avatar tatsuhiro-t commented on August 29, 2024

Yeah, that would work for me.
I'm curious how hard to add ECDSA support to neverbleed. I'm not familiar to OpenSSL Engine thing. So is it just changing function call or parameters?

from neverbleed.

kazuho avatar kazuho commented on August 29, 2024

Looking at https://github.com/openssl/openssl/commits/master/crypto/ec/ec_kmeth.c, it seems like that the EC codecs have just got a engine API defined.

So I assume it would not be hard to add ECDSA support for upcoming releases of OpenSSL by taking the same approach as we do for RSA; e.g. define a engine that sends the parameters over unix socket, and I think the underlying code can be shared between RSA implementaiton and the ECDSA one.

from neverbleed.

tatsuhiro-t avatar tatsuhiro-t commented on August 29, 2024

OK, so we have to wait for the development of OpenSSL.

For the record, I tried to understand neverbleed code, and then
the following is what I got:

  • client process calls *_proxy function via *_METHOD, which sends command to nb daemon process.
  • nb daemon reads command, and calls appropriate *_stub function.

We have already RSA_METHOD for RSA. When new OpenSSL comes, and we
hopefully will get EC_KEY_METHOD (is that correct?), set to
ENGINE. Then, we may add new *_proxy functions and *_stub
functions for EC_KEY. Protocol helper functions can be shared.
We also need add new command name to call proper stub. This can be done by adding prefix like "rsa_sign", etc.

from neverbleed.

tatsuhiro-t avatar tatsuhiro-t commented on August 29, 2024

With the above observation, I somehow managed to add ECDSA support to neverbleed.
I used openssl master branch. Still there is debugging output everywhere, so after some cleanup, I will push my branch to github.

from neverbleed.

kazuho avatar kazuho commented on August 29, 2024

Great! I am looking forward to seeing it.

from neverbleed.

tatsuhiro-t avatar tatsuhiro-t commented on August 29, 2024

See my PR #11
All ECDSA related functions are prefixed with ecdsa_ (one exception though, daemon_{get,set}_ecdsa}). Probably, we should rename all RSA related ones to similar way, but I did not do that.

from neverbleed.

tatsuhiro-t avatar tatsuhiro-t commented on August 29, 2024

Now it compiles with OpenSSL 1.1.0pre5.

from neverbleed.

Related Issues (11)

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.