openssl / openssl

TLS/SSL and crypto library
https://www.openssl.org
Apache License 2.0
25.79k stars 10.13k forks source link

i2v_GENERAL_NAME() & v2i_GENERAL_NAME_ex() strings are inconsistent #11009

Open jwalch opened 4 years ago

jwalch commented 4 years ago

I noticed this in 1.0.2, but I glanced at v3_alt.c in master and it looks like the same issue is still present.

The issue is that the "magic strings" differ slightly for certain types. For GEN_URI, GEN_DNS, GEN_RID they are the same. For GEN_RID, it's "RID" v/s "Registered ID." For GEN_IPADD, it's "IP" v/s "IP Address." And so on.

It seems broken to me that the output of i2v_GENERAL_NAME() cannot necessarily be passed back into v2i_GENERAL_NAME() successfully.

FWIW, GENERAL_NAME_print() also states things in terms of string literals, but perhaps there is some argument for a different value in that context.

t8m commented 3 years ago

Changing/cleaning up stuff like this is IMO rather a feature. Not something that can be treated as a simple bug fix and thus done on released branches. Also PR (against master) to cleanup this would be clearly welcome.

nhorman commented 4 months ago

Marking as inactive, to be closed at the end of 3.4 dev barring further input