[Pkg-javascript-commits] [node-asn1.js] 04/21: 5280: proper enum for `ReasonCode`

Bastien Roucariès rouca at moszumanska.debian.org
Thu Nov 9 10:57:38 UTC 2017


This is an automated email from the git hooks/post-receive script.

rouca pushed a commit to branch upstream
in repository node-asn1.js.

commit c8ce243a7de49731c702e6cdb7ea96a45103e88f
Author: Fedor Indutny <fedor at indutny.com>
Date:   Mon Apr 3 09:25:27 2017 -0400

    5280: proper enum for `ReasonCode`
---
 rfc/5280/index.js           | 13 ++++++++++++-
 rfc/5280/test/basic-test.js |  9 ++++++++-
 2 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/rfc/5280/index.js b/rfc/5280/index.js
index 0aefdd2..8d4553a 100644
--- a/rfc/5280/index.js
+++ b/rfc/5280/index.js
@@ -841,7 +841,18 @@ rfc5280.IssuingDistributionPoint = IssuingDistributionPoint;
 //         privilegeWithdrawn      (9),
 //         aACompromise           (10) }
 var ReasonCode = asn1.define('ReasonCode', function() {
-  this.enum();
+  this.enum({
+    0: 'unspecified',
+    1: 'keyCompromise',
+    2: 'cACompromise',
+    3: 'affiliationChanged',
+    4: 'superseded',
+    5: 'cessationOfOperation',
+    6: 'certificateHold',
+    8: 'removeFromCRL',
+    9: 'privilegeWithdrawn',
+    10: 'aACompromise'
+  });
 });
 rfc5280.ReasonCode = ReasonCode;
 
diff --git a/rfc/5280/test/basic-test.js b/rfc/5280/test/basic-test.js
index 3e6ca53..35ec251 100644
--- a/rfc/5280/test/basic-test.js
+++ b/rfc/5280/test/basic-test.js
@@ -141,8 +141,15 @@ describe('asn1.js RFC5280', function() {
     assert.equal(crl.tbsCertList.revokedCertificates.length, 2)
     assert.deepEqual(crl.tbsCertList.revokedCertificates[0].userCertificate,
                      new asn1.bignum('764bedd38afd51f7', 16));
-    assert.deepEqual(crl.tbsCertList.revokedCertificates[1].userCertificate,
+
+    var cert1 = crl.tbsCertList.revokedCertificates[1];
+    assert.deepEqual(cert1.userCertificate,
                      new asn1.bignum('31da3380182af9b2', 16));
+    assert.equal(cert1.crlEntryExtensions.length, 1);
+
+    var ext1 = cert1.crlEntryExtensions[0];
+    assert.equal(ext1.extnID, 'reasonCode');
+    assert.equal(ext1.extnValue, 'affiliationChanged');
 
     // Downloadable CRL (empty) from distribution point available on cert4.crt
     data = fs.readFileSync(__dirname + '/fixtures/cert4.crl');

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-asn1.js.git



More information about the Pkg-javascript-commits mailing list