[openssl-dev] Dynamically adding a NID

Nicola Tuveri nicola.tuveri at tut.fi
Sun Jun 25 21:07:29 UTC 2017


Hi,

I'm working on ENGINE development, and I have the need to add an NID for a
custom message digest, and eventually for ciphers and PKEY methods.
Some of the associated object don't (and won't ever) have an associated
OID, but I need to add them dynamically to avoid requiring patches to the
upstream OpenSSL code before being able to use my engine.

I'm currently (ab)using OBJ_create() [0], but it looks like it requires to
specify a valid OID.
I know it is possible to have NIDs associated with objects without OID
(e.g. NID_siphash) when they are statically defined in OpenSSL source code,
but I cannot find a way to declare similar objects without OID dynamically.

Before 1.1.0, when structures weren't opaque, I could manipulate the
contents of the created object directly and somehow work around this
limitation, but in 1.1.0 this is not possible.

Does anyone know of the right way to dynamically create an NID associated
with an object without OID?

Thanks.

Nicola


[0] : https://github.com/openssl/openssl/blob/master/include/ope
nssl/objects.h#L157
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mta.openssl.org/pipermail/openssl-dev/attachments/20170626/b7e093a1/attachment-0001.html>


More information about the openssl-dev mailing list