Commit 943a55d
committed
Encode Netscape IA5String extensions correctly (fixes #349)
create_ext has no special case for nsComment (OID 2.16.840.1.113730.1.13)
and other Netscape IA5String extensions, so they fall through to the
generic else branch which double-wraps the value in OCTET STRINGs:
OCTET STRING { OCTET STRING { raw ASCII } }
CRuby's native OpenSSL bindings produce the correct encoding:
OCTET STRING { IA5String "..." }
The malformed encoding causes BouncyCastle to crash when parsing
certificates containing these extensions, as it tries to interpret the
raw ASCII bytes as ASN.1 structures.
Add isNetscapeIA5StringExtension() covering all Netscape extensions
defined as IA5String (nsBaseUrl, nsRevocationUrl, nsCaRevocationUrl,
nsRenewalUrl, nsCaPolicyUrl, nsSslServerName, nsComment). nsCertType
is excluded as it is a BIT STRING already handled separately.1 parent a4b2a1a commit 943a55d
File tree
2 files changed
+46
-0
lines changed- src
- main/java/org/jruby/ext/openssl
- test/ruby/x509
2 files changed
+46
-0
lines changedLines changed: 22 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
214 | 217 | | |
215 | 218 | | |
216 | 219 | | |
| |||
385 | 388 | | |
386 | 389 | | |
387 | 390 | | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
388 | 410 | | |
389 | 411 | | |
390 | 412 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
331 | 331 | | |
332 | 332 | | |
333 | 333 | | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
334 | 358 | | |
335 | 359 | | |
336 | 360 | | |
| |||
0 commit comments