Skip to content

Commit

Permalink
8.0.20 release
Browse files Browse the repository at this point in the history
  • Loading branch information
kjur committed Jun 24, 2020
1 parent 6ef0205 commit adc64c8
Show file tree
Hide file tree
Showing 25 changed files with 1,106 additions and 904 deletions.
15 changes: 15 additions & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@

ChangeLog for jsrsasign

add CSR support for subjectAltName
* Changes From 8.0.19 to 8.0.20
- src/asn1csr.js
- CSRUtil.getInfo
- add ext parameter to show subjectAltName property
- change not to raise error when subject name is empty in CSR
- src/x509.js
- X509.parseExt
- add support for CSR extension request field
- src/asn1hex.js
- ASN1HEX.getIdxbyList
- small update for exception
- test/
- qunit-do-{asn1csr, x509}.html to add tests for above.

ECDSA signature validation maleability fix and others
* Changes from 8.0.18 to 8.0.19
- src/ecdsa-mod.js
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

The 'jsrsasign'(RSA-Sign JavaScript Library) License

Copyright (c) 2010-2018 Kenji Urushima
Copyright (c) 2010-2020 Kenji Urushima

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion api/files.html
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ <h2><a href="symbols/src/asn1csr-1.0.js.html">asn1csr-1.0.js</a></h2>


<dt class="heading">Version:</dt>
<dd>jsrsasign 8.0.5 asn1csr 1.0.6 (2018-Jan-13)</dd>
<dd>jsrsasign 8.0.20 asn1csr 1.0.7 (2020-Jun-24)</dd>



Expand Down
11 changes: 9 additions & 2 deletions api/symbols/KJUR.asn1.csr.CSRUtil.html
Original file line number Diff line number Diff line change
Expand Up @@ -593,15 +593,22 @@ <h1 class="classTitle">
<li>subject.hex - hexadecimal string of X.500 Name of subject</li>
<li>pubkey.obj - subject public key object such as RSAKey, KJUR.crypto.{ECDSA,DSA}</li>
<li>pubkey.hex - hexadecimal string of subject public key</li>
<li>ext - array of extensionRequest parameters</li>
</ul>
NOTE: 'ext' property is supported since jsrsasign 8.0.20 asn1csr 1.0.7 and
ext only support subjectAltName extension at current stage.


</div>



<pre class="code">o = KJUR.asn1.csr.CSRUtil.getInfo("-----BEGIN CERTIFICATE REQUEST...");
console.log(o.subject.name) &rarr; "/C=US/O=Test"</pre>
<pre class="code">KJUR.asn1.csr.CSRUtil.getInfo("-----BEGIN CERTIFICATE REQUEST...") &rarr;
{
subject: { name: "/C=US/O=Test", hex: "30..." },
pubkey: { hex: "30...", obj: KEYOBJECT },
ext: [ { subjectAltName: { array: [["DNS", "example.com"]] } } ]
}</pre>



Expand Down
30 changes: 26 additions & 4 deletions api/symbols/X509.html
Original file line number Diff line number Diff line change
Expand Up @@ -894,9 +894,9 @@ <h1 class="classTitle">
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/X509.html#parseExt">parseExt</a></b>()
<div class="fixedFont"><b><a href="../symbols/X509.html#parseExt">parseExt</a></b>(hCSR)
</div>
<div class="description">set array of X.509v3 extesion information such as extension OID, criticality and value index.</div>
<div class="description">set array of X.509v3 and CSR extesion information such as extension OID, criticality and value index.</div>
</td>
</tr>

Expand Down Expand Up @@ -2768,17 +2768,22 @@ <h1 class="classTitle">
<div class="fixedFont">


<b>parseExt</b>()
<b>parseExt</b>(hCSR)

</div>
<div class="description">
set array of X.509v3 extesion information such as extension OID, criticality and value index.<br/>
set array of X.509v3 and CSR extesion information such as extension OID, criticality and value index.<br/>
This method will set an array of X.509v3 extension information having
following parameters:
<ul>
<li>oid - extension OID (ex. 2.5.29.19)</li>
<li>critical - true or false</li>
<li>vidx - string index for extension value</li>
<br/>
When you want to parse extensionRequest of CSR,
argument 'hCSR' shall be specified.
<br/>
NOTE: CSR is supported from jsrsasign 8.0.20 x509 1.1.22.


</div>
Expand All @@ -2788,12 +2793,29 @@ <h1 class="classTitle">
<pre class="code">x = new X509();
x.readCertPEM(sCertPEM); // parseExt() will also be called internally.

x.aExtInfo &rarr;
[ { oid: "2.5.29,19", critical: true, vidx: 2504 }, ... ]

// to parse CSR
X = new X509()
x.parseExt("-----BEGIN CERTIFICATE REQUEST-----...");
x.aExtInfo &rarr;
[ { oid: "2.5.29,19", critical: true, vidx: 2504 }, ... ]</pre>




<dl class="detailList">
<dt class="heading">Parameters:</dt>

<dt>
<span class="light fixedFont">{String}</span> <b>hCSR</b>

</dt>
<dd>- PEM string of certificate signing requrest(CSR) (OPTION)</dd>

</dl>



<dl class="detailList">
Expand Down
83 changes: 51 additions & 32 deletions api/symbols/src/asn1csr-1.0.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions api/symbols/src/asn1hex-1.1.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,8 @@
<span class='line'>317</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">nthList.length</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>318</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">checkingTag</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>319</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">h.substr</span><span class="PUNC">(</span><span class="NAME">currentIndex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="NAME">checkingTag</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>320</span> </span><span class="WHIT"> </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="STRN">"checking tag doesn't match: "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
<span class='line'>321</span> </span><span class="NAME">h.substr</span><span class="PUNC">(</span><span class="NAME">currentIndex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"!="</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">checkingTag</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>320</span> </span><span class="WHIT"> </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="NAME">Error</span><span class="PUNC">(</span><span class="STRN">"checking tag doesn't match: "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
<span class='line'>321</span> </span><span class="NAME">h.substr</span><span class="PUNC">(</span><span class="NAME">currentIndex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"!="</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">checkingTag</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>322</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>323</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>324</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">currentIndex</span><span class="PUNC">;</span><span class="WHIT">
Expand Down
Loading

0 comments on commit adc64c8

Please sign in to comment.