You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While making PEM_write_bio_PrivateKey_traditional() more strict (see #12728 and #12729), I discovered that our own (legacy in 3.0) backends do not always support traditional output, but since PEM_write_bio_PrivateKey_traditional() didn't check that too closely, some "traditional" output may be PKCS#8 after all.
DH is one example, I haven't investigated others.
I just tested a little with the openssl installed a part of my system:
So basically, you end up getting a PEM file where the headers indicate "traditional", but the contents are PKCS#8 all the same.
Has anyone ever noticed? I suspect that most people have switched to PKCS#8 anyway, so these kinds of bugs go unnoticed for quite a while.
The question is what to do with this. Letting PEM_write_bio_PrivateKey_traditional() output things like the above don't seems right, and squarely contradict the documented intention (from man PEM_write_bio_PrivateKey_traditional):
PEM_write_bio_PrivateKey_traditional() writes out a private key in the "traditional" format with a simple private key marker and should only be used for compatibility with legacy programs.
I can see several possibilities:
Live with it. That's not very appetizing, if not to say plain wrong.
IMO we should do 2. for now, because 1. is clearly a bug. And if there is a fix available to provide 3. during beta phase I think it should be acceptable as a bug fix.
While making
PEM_write_bio_PrivateKey_traditional()
more strict (see #12728 and #12729), I discovered that our own (legacy in 3.0) backends do not always support traditional output, but sincePEM_write_bio_PrivateKey_traditional()
didn't check that too closely, some "traditional" output may be PKCS#8 after all.DH is one example, I haven't investigated others.
I just tested a little with the openssl installed a part of my system:
So basically, you end up getting a PEM file where the headers indicate "traditional", but the contents are PKCS#8 all the same.
Has anyone ever noticed? I suspect that most people have switched to PKCS#8 anyway, so these kinds of bugs go unnoticed for quite a while.
The question is what to do with this. Letting
PEM_write_bio_PrivateKey_traditional()
output things like the above don't seems right, and squarely contradict the documented intention (fromman PEM_write_bio_PrivateKey_traditional
):I can see several possibilities:
In my opinion, this is better than to output PKCS#8 under false pretences.
Our tests will have to be adjusted accoordingly
The text was updated successfully, but these errors were encountered: