tbl_standard.h 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. * Copyright 1999-2016 The OpenSSL Project Authors. All Rights Reserved.
  3. *
  4. * Licensed under the Apache License 2.0 (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. /* size limits: this stuff is taken straight from RFC3280 */
  10. #define ub_name 32768
  11. #define ub_common_name 64
  12. #define ub_locality_name 128
  13. #define ub_state_name 128
  14. #define ub_organization_name 64
  15. #define ub_organization_unit_name 64
  16. #define ub_title 64
  17. #define ub_email_address 128
  18. #define ub_serial_number 64
  19. /* From RFC4524 */
  20. #define ub_rfc822_mailbox 256
  21. /* This table must be kept in NID order */
  22. static const ASN1_STRING_TABLE tbl_standard[] = {
  23. {NID_commonName, 1, ub_common_name, DIRSTRING_TYPE, 0},
  24. {NID_countryName, 2, 2, B_ASN1_PRINTABLESTRING, STABLE_NO_MASK},
  25. {NID_localityName, 1, ub_locality_name, DIRSTRING_TYPE, 0},
  26. {NID_stateOrProvinceName, 1, ub_state_name, DIRSTRING_TYPE, 0},
  27. {NID_organizationName, 1, ub_organization_name, DIRSTRING_TYPE, 0},
  28. {NID_organizationalUnitName, 1, ub_organization_unit_name, DIRSTRING_TYPE,
  29. 0},
  30. {NID_pkcs9_emailAddress, 1, ub_email_address, B_ASN1_IA5STRING,
  31. STABLE_NO_MASK},
  32. {NID_pkcs9_unstructuredName, 1, -1, PKCS9STRING_TYPE, 0},
  33. {NID_pkcs9_challengePassword, 1, -1, PKCS9STRING_TYPE, 0},
  34. {NID_pkcs9_unstructuredAddress, 1, -1, DIRSTRING_TYPE, 0},
  35. {NID_givenName, 1, ub_name, DIRSTRING_TYPE, 0},
  36. {NID_surname, 1, ub_name, DIRSTRING_TYPE, 0},
  37. {NID_initials, 1, ub_name, DIRSTRING_TYPE, 0},
  38. {NID_serialNumber, 1, ub_serial_number, B_ASN1_PRINTABLESTRING,
  39. STABLE_NO_MASK},
  40. {NID_friendlyName, -1, -1, B_ASN1_BMPSTRING, STABLE_NO_MASK},
  41. {NID_name, 1, ub_name, DIRSTRING_TYPE, 0},
  42. {NID_dnQualifier, -1, -1, B_ASN1_PRINTABLESTRING, STABLE_NO_MASK},
  43. {NID_domainComponent, 1, -1, B_ASN1_IA5STRING, STABLE_NO_MASK},
  44. {NID_ms_csp_name, -1, -1, B_ASN1_BMPSTRING, STABLE_NO_MASK},
  45. {NID_rfc822Mailbox, 1, ub_rfc822_mailbox, B_ASN1_IA5STRING,
  46. STABLE_NO_MASK},
  47. {NID_jurisdictionCountryName, 2, 2, B_ASN1_PRINTABLESTRING, STABLE_NO_MASK},
  48. {NID_INN, 1, 12, B_ASN1_NUMERICSTRING, STABLE_NO_MASK},
  49. {NID_OGRN, 1, 13, B_ASN1_NUMERICSTRING, STABLE_NO_MASK},
  50. {NID_SNILS, 1, 11, B_ASN1_NUMERICSTRING, STABLE_NO_MASK},
  51. {NID_countryCode3c, 3, 3, B_ASN1_PRINTABLESTRING, STABLE_NO_MASK},
  52. {NID_countryCode3n, 3, 3, B_ASN1_NUMERICSTRING, STABLE_NO_MASK},
  53. {NID_dnsName, 0, -1, B_ASN1_UTF8STRING, STABLE_NO_MASK}
  54. };