yuezonghe | 824eb0c | 2024-06-27 02:32:26 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 1999-2016 The OpenSSL Project Authors. All Rights Reserved. |
| 3 | * |
| 4 | * Licensed under the OpenSSL license (the "License"). You may not use |
| 5 | * this file except in compliance with the License. You can obtain a copy |
| 6 | * in the file LICENSE in the source distribution or at |
| 7 | * https://www.openssl.org/source/license.html |
| 8 | */ |
| 9 | |
| 10 | /* size limits: this stuff is taken straight from RFC3280 */ |
| 11 | |
| 12 | #define ub_name 32768 |
| 13 | #define ub_common_name 64 |
| 14 | #define ub_locality_name 128 |
| 15 | #define ub_state_name 128 |
| 16 | #define ub_organization_name 64 |
| 17 | #define ub_organization_unit_name 64 |
| 18 | #define ub_title 64 |
| 19 | #define ub_email_address 128 |
| 20 | #define ub_serial_number 64 |
| 21 | |
| 22 | /* From RFC4524 */ |
| 23 | |
| 24 | #define ub_rfc822_mailbox 256 |
| 25 | |
| 26 | /* This table must be kept in NID order */ |
| 27 | |
| 28 | static const ASN1_STRING_TABLE tbl_standard[] = { |
| 29 | {NID_commonName, 1, ub_common_name, DIRSTRING_TYPE, 0}, |
| 30 | {NID_countryName, 2, 2, B_ASN1_PRINTABLESTRING, STABLE_NO_MASK}, |
| 31 | {NID_localityName, 1, ub_locality_name, DIRSTRING_TYPE, 0}, |
| 32 | {NID_stateOrProvinceName, 1, ub_state_name, DIRSTRING_TYPE, 0}, |
| 33 | {NID_organizationName, 1, ub_organization_name, DIRSTRING_TYPE, 0}, |
| 34 | {NID_organizationalUnitName, 1, ub_organization_unit_name, DIRSTRING_TYPE, |
| 35 | 0}, |
| 36 | {NID_pkcs9_emailAddress, 1, ub_email_address, B_ASN1_IA5STRING, |
| 37 | STABLE_NO_MASK}, |
| 38 | {NID_pkcs9_unstructuredName, 1, -1, PKCS9STRING_TYPE, 0}, |
| 39 | {NID_pkcs9_challengePassword, 1, -1, PKCS9STRING_TYPE, 0}, |
| 40 | {NID_pkcs9_unstructuredAddress, 1, -1, DIRSTRING_TYPE, 0}, |
| 41 | {NID_givenName, 1, ub_name, DIRSTRING_TYPE, 0}, |
| 42 | {NID_surname, 1, ub_name, DIRSTRING_TYPE, 0}, |
| 43 | {NID_initials, 1, ub_name, DIRSTRING_TYPE, 0}, |
| 44 | {NID_serialNumber, 1, ub_serial_number, B_ASN1_PRINTABLESTRING, |
| 45 | STABLE_NO_MASK}, |
| 46 | {NID_friendlyName, -1, -1, B_ASN1_BMPSTRING, STABLE_NO_MASK}, |
| 47 | {NID_name, 1, ub_name, DIRSTRING_TYPE, 0}, |
| 48 | {NID_dnQualifier, -1, -1, B_ASN1_PRINTABLESTRING, STABLE_NO_MASK}, |
| 49 | {NID_domainComponent, 1, -1, B_ASN1_IA5STRING, STABLE_NO_MASK}, |
| 50 | {NID_ms_csp_name, -1, -1, B_ASN1_BMPSTRING, STABLE_NO_MASK}, |
| 51 | {NID_rfc822Mailbox, 1, ub_rfc822_mailbox, B_ASN1_IA5STRING, |
| 52 | STABLE_NO_MASK}, |
| 53 | {NID_jurisdictionCountryName, 2, 2, B_ASN1_PRINTABLESTRING, STABLE_NO_MASK}, |
| 54 | {NID_INN, 1, 12, B_ASN1_NUMERICSTRING, STABLE_NO_MASK}, |
| 55 | {NID_OGRN, 1, 13, B_ASN1_NUMERICSTRING, STABLE_NO_MASK}, |
| 56 | {NID_SNILS, 1, 11, B_ASN1_NUMERICSTRING, STABLE_NO_MASK}, |
| 57 | {NID_countryCode3c, 3, 3, B_ASN1_PRINTABLESTRING, STABLE_NO_MASK}, |
| 58 | {NID_countryCode3n, 3, 3, B_ASN1_NUMERICSTRING, STABLE_NO_MASK}, |
| 59 | {NID_dnsName, 0, -1, B_ASN1_UTF8STRING, STABLE_NO_MASK} |
| 60 | }; |
| 61 | |