Facing error while writing the generated parameters to PEM file #10
-
Hi,
In the above code, "IMPLEMENT_PEM_provided_write_body_main(pkey, bio);" not getting executed resulting in error. I would like know what can be the root cause for this? Does Keymgmt needs to be in certain structure or is there any particular function that needs to be implemented? My keydata is properly getting assigned in EVP_PKEY structure as well. Any hint will be really helpful. I have been going through the code for a long time and couldn't figure out. Thank you!! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 16 replies
-
The PEM routines aren't at fault here, neither is keymgmt. However, there is a disconnect, since the PEM routines (or the DER routines that they build upon) cannot know how to deal with your keydata with keymgmt alone. To enable PEM data to be written, the PEM routines (or well, the DER routines, really, they need the help of an encoder, that belongs in the same provider as the keymgmt, and therefore should know the contents of the keydata, and thereby be able to encode the keydata into a suitable DER or PEM stream. This is probably among the more complex parts of writing a provider. I suggest starting with provider-encoder(7), and see what you can figure out from there. |
Beta Was this translation helpful? Give feedback.
This... actually looks like a bug in the libcrypto STORE code. Although, this comment a little higher up does say that this is going to happen (and confirms your conclusion):
But, there is this obvious third situation, that the keydata material comes from the same provider as the keymgmt, i.e. your situation. That's a pretty big omission!
(from over at OpenSSL, I do recall some commentary from t…