-
Notifications
You must be signed in to change notification settings - Fork 4
/
924.txt
232 lines (177 loc) · 11.3 KB
/
924.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
[31] [[ASN.1]] にはいろいろな[[文字列型]]があります。
* 仕様書
[REFS[
- [4] [CITE@en[RFC 4517 - Lightweight Directory Access Protocol (LDAP): Syntaxes and Matching Rules]]
([TIME[2015-03-08 19:15:43 +09:00]] 版)
<http://tools.ietf.org/html/rfc4517#section-3.3.15>
- [6] [CITE@en[RFC 4517 - Lightweight Directory Access Protocol (LDAP): Syntaxes and Matching Rules]] ([TIME[2015-03-08 19:15:43 +09:00]] 版) <http://tools.ietf.org/html/rfc4517#section-4.2>
- [9] [CITE@en[RFC 4518 - Lightweight Directory Access Protocol (LDAP): Internationalized String Preparation]] ([TIME[2014-12-29 00:45:51 +09:00]] 版) <http://tools.ietf.org/html/rfc4518#section-2.1>
- [1] '''[CITE@en[RFC 5280 - Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile]] ([TIME[2015-02-22 15:44:10 +09:00]] 版) <http://tools.ietf.org/html/rfc5280#section-4.1.2.4>'''
- [20] [CITE@en[RFC 5280 - Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile]] ([TIME[2015-02-22 15:44:10 +09:00]] 版) <http://tools.ietf.org/html/rfc5280#section-4.1.2.6>
- [27] [CITE@en[RFC 5280 - Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile]] ([TIME[2015-02-22 15:44:10 +09:00]] 版) <http://tools.ietf.org/html/rfc5280#section-7.1>
]REFS]
* [CODE[IA5String]]
[FIG(quote)[
[FIGCAPTION[
[5] >>4
]FIGCAPTION]
> A value of the IA5 String syntax is a string of zero, one, or more
characters from International Alphabet 5 (IA5) [T.50], the
international version of the ASCII character set. The LDAP-specific
encoding of a value of this syntax is the unconverted string of
characters, which conforms to the <IA5String> rule in Section 3.2.
> The LDAP definition for the IA5 String syntax is:
[PRE[
( 1.3.6.1.4.1.1466.115.121.1.26 DESC 'IA5 String' )
]PRE]
> This syntax corresponds to the IA5String ASN.1 type from [ASN.1].
]FIG]
* [CODE[PrintableString]]
[3] RFC 987, RFC 1138, RFC 1148,
RFC 1327 <urn:ietf:rfc:1327>, RFC 2156 <urn:ietf:rfc:2156>
で定義されています。
[34] [CITE@en[RFC 4517 - Lightweight Directory Access Protocol (LDAP): Syntaxes and Matching Rules]]
([TIME[2015-03-08 19:15:43 +09:00]] 版)
<http://tools.ietf.org/html/rfc4517#section-3.3.29>
** 構文
printable-string = *(ps-delim / ps-restricted-char)
ps-restricted-char = DIGIT / ALPHA / " " / "'" / "+"
/ "," / "-" / "." / "/" / ":" / "=" / "?"
ps-delim = "(" / ")"
ps-encoded = *( ps-restricted-char / ps-encoded-char )
ps-encoded-char = "(a)" ; (@)
/ "(p)" ; (%)
/ "(b)" ; (!)
/ "(q)" ; (")
/ "(u)" ; (_)
/ "(l)" ; "("
/ "(r)" ; ")"
/ "(" 3DIGIT ")" ; 000 - 127 (= ASCII %x00-7E)
大文字・小文字は区別しませんが、常に小文字で生成します。
(l), (r) は RFC 987 では定義されていませんでした。
**例
'a demo.' <-> 'a demo.'
foo(a)bar <-> foo@bar
(q)(u)(p)(q) <-> "_%"
(a) <-> @
(A) -> @
(l)a(r) <-> (a)
(126) <-> ~
( -> (
(l) <-> (
* [CODE[DirectoryString]]
[11] [DFN[[CODE[[[DirectoryString]]]]]] は、 [CODE[[[TeletexString]]]],
[CODE[[[PrintableString]]]], [CODE[[[UniversalString]]]],
[CODE[[[UTF8String]]]], [CODE[[[BMPString]]]] のいずれかによる空でない列です [SRC[>>1]]。
;; [2] [CODE[[[IA5String]]]] は含まれていません。
[14] [[RFC 5280]] [[プロファイル]]に適合する [[CA]] は、
原則として [CODE[[[PrintableString]]]] か [CODE[[[UTF8String]]]]
を用いなければ[['''なりません''']] [SRC[>>1, >>20]]。
[15] [[CA]] が従来 [CODE[[[issuer]]]] [[欄]]において
[CODE[[[TeletexString]]]], [CODE[[[BMPString]]]],
[CODE[[[UniversalString]]]] で[[証明書]]を[[発行]]していたなら、
[[後方互換性]]のため引き続きこれを利用しても構いません [SRC[>>1]]。
[16] 既存の [[CA]] が >>15 のような[[証明書]]を発行しているところに新しい [[CA]]
を追加する場合、既存の [[CA]] が使っているものと同じ方法で[[属性]]を[[符号化]]して構いません。 [SRC[>>1]]
[22] [[証明書]]の [CODE[[[subject]]]] が [[CA]] の場合には、 >>15 のような
[CODE[[[issuer]]]] が [[CA]] の[[証明書]]で使われているなら、それと同じ方法で[[符号化]]しなければ[['''なりません''']] [SRC[>>20]]。
[23] [[証明書]]の [CODE[[[subject]]]] が [[CRL発行者]]の場合には、
当該[[CRL発行者]]の[[発行]]する [[CRL]] の [CODE[[[issuer]]]]
[[欄]]と同じ方法で[[符号化]]しなければ[['''なりません''']] [SRC[>>20]]。
[24] 既存の [[subject]] に新しい[[証明書]]を発行する場合や、
他の [[subject]] に発行した[[証明書]]で既に[[符号化]]された[[属性]]を新たな
[[subject]] に発行する場合には、 [CODE[[[TeletexString]]]], [CODE[[[BMPString]]]],
[CODE[[[UniversalString]]]] で [CODE[[[subject]]]] を[[符号化]]して構いません。 [SRC[>>20]]
[25] [[証明書]]の[[利用者]]は、 [CODE[[[TeletexString]]]], [CODE[[[BMPString]]]],
[CODE[[[UniversalString]]]] の [CODE[[[subject]]]] の受信にも備える[['''べきです''']] [SRC[>>20]]。しかし対応は義務ではありません [SRC[>>27]]。
* Unicode への変換
[10] [[RFC 4518]] の [[LDAP]] 用 [[stringprep]] においては、
[RUBYB[[[転符号化]]]@en[Transcoding]]手順において [[Unicode]] に変換する方法が規定されています。
[12] [CODE[[[PrintableString]]]] は、直接 [[Unicode]] へと[[転符号化]]します [SRC[>>9]]。
[13] [CODE[[[UniversalString]]]], [CODE[[[UTF8String]]]], [CODE[[[bmpString]]]]
は、既に [[Unicode]] なので[[転符号化]]は不要です [SRC[>>9]]。
[17] [CODE[[[TeletexString]]]] は、 [[Unicode]] に[[転符号化]]します。
ただし標準の[[写像]]はありませんから、実装に委ねられます。
これもあって、 [CODE[[[TeletexString]]]] は使う[['''べきではありません''']]。 [SRC[>>9]]
* 比較
[7] [[RFC 4517]] は、[[文字列]]に関する次の[[比較]]演算を規定しています [SRC[>>6]]。
[FIG(short list)[
- [CODE[[[numericStringMatch]]]]
- [CODE[[[numericStringSubstringsMatch]]]]
- [CODE[[[caseExactMatch]]]]
- [CODE[[[caseExactOrderingMatch]]]]
- [CODE[[[caseExactSubstringsMatch]]]]
- [CODE[[[caseExactIA5Match]]]]
- [CODE[[[caseIgnoreIA5Match]]]]
- [CODE[[[caseIgnoreIA5SubstringsMatch]]]]
- [CODE[[[caseIgnoreListMatch]]]]
- [CODE[[[caseIgnoreListSubstringsMatch]]]]
- [CODE[[[caseIgnoreMatch]]]]
- [CODE[[[caseIgnoreOrderingMatch]]]]
- [CODE[[[caseIgnoreSubstringsMatch]]]]
- [CODE[[[directoryStringFirstComponentMatch]]]]
- [CODE[[[telephoneNumberMatch]]]]
- [CODE[[[telephoneNumberSubstringsMatch]]]]
- [CODE[[[wordMatch]]]]
]FIG]
[8] これらは [[RFC 4518]] の [[Stringprep]] 変種を使って[[正規化]]して[[比較]]します。
[18] [[インターネットPKI]]においては、実装は [CODE[[[PrintableString]]]] や
[CODE[[[UTF8String]]]] の [[distinguished name]] [[属性]]の[[比較]]に当たり
[[RFC 4518]] が規定する [[stringprep]] [[プロファイル]]を適用しなければ[['''なりません''']]。
実装は [CODE[[[caseIgnoreMatch]]]] による比較に対応しなければ[['''なりません''']]。
それ以外の比較方式を使う[[属性型]]への対応は必須ではありません。 [SRC[>>27]]
;; [CODE[[[caseIgnoreMatch]]]] のための [[stringprep]] では、
[[Map]] 手順で [[RFC 3453]] 表B.2 を用いた [[case folding]] を行います。
また [[Insignificant Character Removal]] 手順で [[Insignificant Space Handling]]
を用います。 [SRC[>>27]] 詳しくは [[stringprep]] を参照。
;; [21] [CODE[[[CN]]]] の[[ドメイン名]]や[[IPアドレス]]を [[service identity]]
検証のために比較する場合も理論上は本規定が適用されるのかもしれませんが、
実際には [[ASCII文字]]のみで構成されるため ([[IDN]] は [[Aラベル]]に変換され、
[[IPアドレス]]もバイト列ではなく文字列表現となるため)、事実上本規定の影響は受けません。
[CODE[[[CN]]]] や [[service identity]] を参照。
* 関連
[SEE[ [CODE[T51String]] ]]
* メモ
[FIG(quote)[
[FIGCAPTION[
[19] [CITE@en[RFC 5280 - Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile]]
([TIME[2015-02-22 15:44:10 +09:00]] 版)
<http://tools.ietf.org/html/rfc5280#page-104>
]FIGCAPTION]
> Some legacy implementations support names encoded in the ISO 8859-1
> character set (Latin1String) '''['''ISO8859''']''' but tag them as TeletexString.
> TeletexString encodes a larger character set than ISO 8859-1, but it
> encodes some characters differently. The name comparison rules
> specified in Section 7.1 assume that TeletexStrings are encoded as
> described in the ASN.1 standard. When comparing names encoded using
> the Latin1String character set, false positives and negatives are
> possible.
]FIG]
[26] [CITE@ja[自堕落な技術者の日記 : OpenSSLで対応しているDirectoryStringType一覧 - livedoor Blog(ブログ)]]
([TIME[2015-04-04 20:40:23 +09:00]] 版)
<http://blog.livedoor.jp/k_urushima/archives/597202.html>
[FIG(quote)[
[FIGCAPTION[
[28] [CITE@en[RFC 7612 - Lightweight Directory Access Protocol (LDAP): Schema for Printer Services]]
([TIME[2015-07-01 10:20:12 +09:00]] 版)
<https://tools.ietf.org/html/rfc7612#section-1.4.1>
]FIGCAPTION]
> DirectoryString
]FIG]
[FIG(quote)[
[FIGCAPTION[
[29] [CITE@en[1088998 – ssl_error_bad_cert_domain on some Akamai-hosted sites (developer.nvidia.com, schwabcdn.com) due to lack of subjectAltName and TeletexString-encoded Subject CN]]
( ([TIME[2016-05-08 22:16:11 +09:00]]))
<https://bugzilla.mozilla.org/show_bug.cgi?id=1088998>
]FIGCAPTION]
> "The issue with the www.joes-ssl.com certificate is mainly that it doesn't use an escape sequence to specify that it's using one of the JIS encodings... and while the MS CryptoAPI apparently uses heuristics for figuring out the correct set, NSS always treats TeletexStrings as ISO-8859-1 strings (http://mxr.mozilla.org/mozilla/source/security/nss/lib/certdb/secname.c?mark=654-661#643)."
]FIG]
[30] [CITE@en[1089104 – ssl_error_bad_cert_domain when subjectAltName extension is missing and Subject CN is encoded as TeletexString]]
( ([TIME[2016-05-08 22:40:40 +09:00]]))
<https://bugzilla.mozilla.org/show_bug.cgi?id=1089104>
[32] [CITE@en[1089104 - ssl_error_bad_cert_domain when subjectAltName extension is missing and Subject CN is encoded as TeletexString]]
([TIME[2018-08-11 20:22:14 +09:00]])
<https://bugzilla.mozilla.org/show_bug.cgi?id=1089104>
[33] [CITE@en[245609 - Mozilla not getting certificate issuer from Authority Information Access CA Issuers]]
([TIME[2018-08-25 22:37:36 +09:00]])
<https://bugzilla.mozilla.org/show_bug.cgi?id=245609#c20>