<div dir="ltr">When creating a CSR, openssl displays the following<div><br></div><div><quote></div><div>State or Province Name (full name) [Some-State]:<br></div><div></quote></div><div><br></div><div>But, I can't find anywhere in the OpenSSL codebase that validates that the input is indeed a "full name"--e.g., that the input is "New York" instead of "NY".</div><div><br></div><div>I've done this search in Github:</div><div><a href="https://github.com/openssl/openssl/search?utf8=%E2%9C%93&q=state%2Fprovince&type=Code">https://github.com/openssl/openssl/search?utf8=%E2%9C%93&q=state%2Fprovince&type=Code</a><br></div><div><br></div><div>After looking through the code, I stumbed across the "ub_locality_name" size limit:</div><div><a href="https://goo.gl/zAUe9w">https://goo.gl/zAUe9w</a><br></div><div><br></div><div>And a couple lines up from that is a comment pointing to <a href="https://www.rfc-editor.org/rfc/rfc3280.txt">RFC 3280</a>, which defines the following:</div><div><pre style="line-height:normal;word-wrap:break-word;white-space:pre-wrap"><quote></pre><pre style="line-height:normal;word-wrap:break-word;white-space:pre-wrap">id-at-stateOrProvinceName AttributeType ::= { id-at 8 }

X520StateOrProvinceName ::= CHOICE {
      teletexString     TeletexString   (SIZE (1..ub-state-name)),
      printableString   PrintableString (SIZE (1..ub-state-name)),
      universalString   UniversalString (SIZE (1..ub-state-name)),
      utf8String        UTF8String      (SIZE (1..ub-state-name)),
      bmpString         BMPString       (SIZE(1..ub-state-name)) }
</pre><pre style="line-height:normal;word-wrap:break-word;white-space:pre-wrap"><pre style="word-wrap:break-word;white-space:pre-wrap">ub-state-name INTEGER ::= 128</pre><pre style="word-wrap:break-word;white-space:pre-wrap"></quote></pre></pre>I'm curious about this because the openssl command will create a CSR where stateOrProvince has a two-character (U.S.) state name, and (at least one) CA (Comodo) will happily issue a cert using such a CSR. </div><div><br></div><div>Is there any issue with a cert generated using such a CSR? Should the openssl command validate stateOrProvince? If not, then maybe it's just a matter of changing the prompt (I'm happy to submit a PR for such a minor change).</div><div><br></div><div>Thanks,</div><div>Tim</div><div><br class="inbox-inbox-Apple-interchange-newline"></div></div>