[Pkg-javascript-commits] [node-asn1.js] 148/202: rfc: remove 3280

Bastien Roucariès rouca at moszumanska.debian.org
Thu Apr 20 19:19:03 UTC 2017


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

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

commit 90c52f98ea6faa33306e1c964cef27f525857ae5
Author: Fedor Indutny <fedor at indutny.com>
Date:   Sat Feb 20 00:36:52 2016 -0500

    rfc: remove 3280
---
 rfc/3280/index.js           | 202 --------------------------------------------
 rfc/3280/package.json       |  24 ------
 rfc/3280/test/basic-test.js | 129 ----------------------------
 3 files changed, 355 deletions(-)

diff --git a/rfc/3280/index.js b/rfc/3280/index.js
deleted file mode 100644
index a0ef29c..0000000
--- a/rfc/3280/index.js
+++ /dev/null
@@ -1,202 +0,0 @@
-try {
-  var asn1 = require('asn1.js');
-} catch (e) {
-  var asn1 = require('../' + '..');
-}
-
-var CRLReason = asn1.define('CRLReason', function() {
-  this.enum({
-    0: 'unspecified',
-    1: 'keyCompromise',
-    2: 'CACompromise',
-    3: 'affiliationChanged',
-    4: 'superseded',
-    5: 'cessationOfOperation',
-    6: 'certificateHold',
-    8: 'removeFromCRL',
-    9: 'privilegeWithdrawn',
-    10: 'AACompromise'
-  });
-});
-exports.CRLReason = CRLReason;
-
-var AlgorithmIdentifier = asn1.define('AlgorithmIdentifier', function() {
-  this.seq().obj(
-    this.key('algorithm').objid(),
-    this.key('parameters').optional().any()
-  );
-});
-exports.AlgorithmIdentifier = AlgorithmIdentifier;
-
-var Certificate = asn1.define('Certificate', function() {
-  this.seq().obj(
-    this.key('tbsCertificate').use(TBSCertificate),
-    this.key('signatureAlgorithm').use(AlgorithmIdentifier),
-    this.key('signature').bitstr()
-  );
-});
-exports.Certificate = Certificate;
-
-var TBSCertificate = asn1.define('TBSCertificate', function() {
-  this.seq().obj(
-    this.key('version').def('v1').explicit(0).use(Version),
-    this.key('serialNumber').use(CertificateSerialNumber),
-    this.key('signature').use(AlgorithmIdentifier),
-    this.key('issuer').use(Name),
-    this.key('validity').use(Validity),
-    this.key('subject').use(Name),
-    this.key('subjectPublicKeyInfo').use(SubjectPublicKeyInfo),
-
-    // TODO(indutny): validate that version is v2 or v3
-    this.key('issuerUniqueID').optional().explicit(1).use(UniqueIdentifier),
-    this.key('subjectUniqueID').optional().explicit(2).use(UniqueIdentifier),
-
-    // TODO(indutny): validate that version is v3
-    this.key('extensions').optional().explicit(3).use(Extensions)
-  );
-});
-exports.TBSCertificate = TBSCertificate;
-
-var Version = asn1.define('Version', function() {
-  this.int({
-    0: 'v1',
-    1: 'v2',
-    2: 'v3'
-  });
-});
-exports.Version = Version;
-
-var CertificateSerialNumber = asn1.define('CertificateSerialNumber',
-                                          function() {
-  this.int();
-});
-exports.CertificateSerialNumber = CertificateSerialNumber;
-
-var Validity = asn1.define('Validity', function() {
-  this.seq().obj(
-    this.key('notBefore').use(Time),
-    this.key('notAfter').use(Time)
-  );
-});
-exports.Validity = Validity;
-
-var Time = asn1.define('Time', function() {
-  this.choice({
-    utcTime: this.utctime(),
-    genTime: this.gentime()
-  });
-});
-exports.Time = Time;
-
-var UniqueIdentifier = asn1.define('UniqueIdentifier', function() {
-  this.bitstr();
-});
-exports.UniqueIdentifier = UniqueIdentifier;
-
-var SubjectPublicKeyInfo = asn1.define('SubjectPublicKeyInfo', function() {
-  this.seq().obj(
-    this.key('algorithm').use(AlgorithmIdentifier),
-    this.key('subjectPublicKey').bitstr()
-  );
-});
-exports.SubjectPublicKeyInfo = SubjectPublicKeyInfo;
-
-var Extensions = asn1.define('Extensions', function() {
-  this.seqof(Extension);
-});
-exports.Extensions = Extensions;
-
-var Extension = asn1.define('Extension', function() {
-  this.seq().obj(
-    this.key('extnID').objid(),
-    this.key('critical').bool().def(false),
-    this.key('extnValue').octstr()
-  );
-});
-exports.Extension = Extension;
-
-var Name = asn1.define('Name', function() {
-  this.choice({
-    rdn: this.use(RDNSequence)
-  });
-});
-exports.Name = Name;
-
-var RDNSequence = asn1.define('RDNSequence', function() {
-  this.seqof(RelativeDistinguishedName);
-});
-exports.RDNSequence = RDNSequence;
-
-var RelativeDistinguishedName = asn1.define('RelativeDistinguishedName',
-                                            function() {
-  this.setof(AttributeTypeAndValue);
-});
-exports.RelativeDistinguishedName = RelativeDistinguishedName;
-
-var AttributeTypeAndValue = asn1.define('AttributeTypeAndValue', function() {
-  this.seq().obj(
-    this.key('type').use(AttributeType),
-    this.key('value').use(AttributeValue)
-  );
-});
-exports.AttributeTypeAndValue = AttributeTypeAndValue;
-
-var AttributeType = asn1.define('AttributeType', function() {
-  this.objid();
-});
-exports.AttributeType = AttributeType;
-
-var AttributeValue = asn1.define('AttributeValue', function() {
-  this.any();
-});
-exports.AttributeValue = AttributeValue;
-
-var GeneralNames = asn1.define('GeneralNames', function() {
-  this.seqof(GeneralName);
-});
-exports.GeneralNames = GeneralNames;
-
-var GeneralName = asn1.define('GeneralName', function() {
-  return this.choice({
-    otherName: this.implicit(0).use(AnotherName),
-    rfc822Name: this.implicit(1).ia5str(),
-    dNSName: this.implicit(2).ia5str(),
-
-    // OpenSSL says:
-    // X509_NAME is a CHOICE type so use EXPLICIT
-    directoryName: this.explicit(4).use(Name),
-
-    // TODO(indutny): requires DirectoryString, ORAddress
-    // ediPartyName: this.implicit(5).use(EDIPartyName),
-    // x400Address: this.implicit(3).use(ORAddress),
-
-    uniformResourceIdentifier: this.implicit(6).ia5str(),
-    iPAddress: this.implicit(7).octstr(),
-    registeredID: this.implicit(8).objid()
-  });
-});
-exports.GeneralName = GeneralName;
-
-var AnotherName = asn1.define('AnotherName', function() {
-  return this.seq().obj(
-    this.key('type-id').objid(),
-    this.key('value').explicit(0).any()
-  );
-});
-exports.AnotherName = AnotherName;
-
-exports['id-pe-authorityInfoAccess'] = [ 1, 3, 6, 1, 5, 5, 7, 1, 1];
-
-var AuthorityInfoAccessSyntax = asn1.define('AuthorityInfoAccessSyntax',
-                                            function() {
-  this.seqof(AccessDescription);
-});
-exports.AuthorityInfoAccessSyntax = AuthorityInfoAccessSyntax;
-
-var AccessDescription = asn1.define('AccessDescription', function() {
-  this.seq().obj(
-    this.key('accessMethod').objid(),
-    this.key('accessLocation').use(GeneralName)
-  );
-});
-exports.AccessDescription = AccessDescription;
diff --git a/rfc/3280/package.json b/rfc/3280/package.json
deleted file mode 100644
index f945fc2..0000000
--- a/rfc/3280/package.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
-  "name": "asn1.js-rfc3280",
-  "version": "4.0.0",
-  "description": "RFC3280 structures for asn1.js",
-  "main": "index.js",
-  "repository": {
-    "type": "git",
-    "url": "git at github.com:indutny/asn1.js"
-  },
-  "keywords": [
-    "asn1",
-    "rfc3280",
-    "der"
-  ],
-  "author": "Fedor Indutny",
-  "license": "MIT",
-  "bugs": {
-    "url": "https://github.com/indutny/asn1.js/issues"
-  },
-  "homepage": "https://github.com/indutny/asn1.js",
-  "peerDependencies": {
-    "asn1.js": "^4.0.0"
-  }
-}
diff --git a/rfc/3280/test/basic-test.js b/rfc/3280/test/basic-test.js
deleted file mode 100644
index 37843a2..0000000
--- a/rfc/3280/test/basic-test.js
+++ /dev/null
@@ -1,129 +0,0 @@
-var assert = require('assert');
-var asn1 = require('../../../');
-var rfc3280 = require('..');
-
-var Buffer = require('buffer').Buffer;
-
-describe('asn1.js RFC3280', function() {
-  it('should decode Certificate', function() {
-    var data = new Buffer(
-      '308204763082035ea0030201020208462e4256bb1194dc300d06092a864886f70d0101' +
-      '0505003049310b300906035504061302555331133011060355040a130a476f6f676c65' +
-      '20496e63312530230603550403131c476f6f676c6520496e7465726e65742041757468' +
-      '6f72697479204732301e170d3134303733303132303434305a170d3134313032383030' +
-      '303030305a3068310b30090603550406130255533113301106035504080c0a43616c69' +
-      '666f726e69613116301406035504070c0d4d6f756e7461696e20566965773113301106' +
-      '0355040a0c0a476f6f676c6520496e633117301506035504030c0e7777772e676f6f67' +
-      '6c652e636f6d30820122300d06092a864886f70d01010105000382010f003082010a02' +
-      '82010100b7894e02f9ba01e07889d670fd3618d6022efc96c9d9deae2e800aa19f4b17' +
-      '20c371b9996b2efc12fa191b60a92afe76e80e5d9d47280cbc46a4cd9cf454503fefcf' +
-      'cd2e1c8b113a89bcd1f1427ae793bbd0d1e077bc963ff2ceb2b0c9ab68196fce1b2f40' +
-      '0dc77d6294a7c0d50ff104cf92ee837d5c484a3ba0ce76b9c018cf96545f7e27518232' +
-      '57874945f87b69bac902ce4b378746953c619db909e73fd2f5e2dd009c5c748ec22fcb' +
-      'd6648fe60a5805e98ab8cd65ab0eb0772d7a19aefdc24c9a3933692ca695e7b493f8ac' +
-      '7aab8e5d1229f071cf08ac0b6c641704a74747faacfb857b68359fc1a98c777fb5eb3e' +
-      '9c90d6a13b78f42d6d797fd74f03c30203010001a38201413082013d301d0603551d25' +
-      '0416301406082b0601050507030106082b0601050507030230190603551d1104123010' +
-      '820e7777772e676f6f676c652e636f6d306806082b06010505070101045c305a302b06' +
-      '082b06010505073002861f687474703a2f2f706b692e676f6f676c652e636f6d2f4749' +
-      '4147322e637274302b06082b06010505073001861f687474703a2f2f636c69656e7473' +
-      '312e676f6f676c652e636f6d2f6f637370301d0603551d0e04160414e43d6cc20c12e9' +
-      '7c1920533676ef287737d8884a300c0603551d130101ff04023000301f0603551d2304' +
-      '18301680144add06161bbcf668b576f581b6bb621aba5a812f30170603551d20041030' +
-      '0e300c060a2b06010401d67902050130300603551d1f042930273025a023a021861f68' +
-      '7474703a2f2f706b692e676f6f676c652e636f6d2f47494147322e63726c300d06092a' +
-      '864886f70d010105050003820101002d5501bd33f7b6e06117e53ccf21703565f29ab7' +
-      '8642a771effa4369f32938b45f04208d88a1046ba0a726622e864143c8dac38392430d' +
-      'fbea1b7d41c1e27dd43438a47d36c4a048de318be442abed5f60373687d01b7fefc43e' +
-      '0aacf620b11a69fb237aaa4dc33b97bc0eb39b1abe6902b1518253addda25037389c26' +
-      '0ef2808be7f702f47a6466d6f3b35764f088c94e0a2b9ee403602ae21cbad3fd8e873e' +
-      '9e817945a3d23fd2b35579cce19ea7f8815d166f3e46d53eed25ef391a912bb715af64' +
-      'e43e124f98be487f9d222954a5bebc8d5ca384c7128c6dabffb11150a7d2a62ce565b8' +
-      'a02a6c4c8ecfc7ac7065c1979cb8d50eabd5d36c72a5396e712e',
-      'hex');
-
-    var res = rfc3280.Certificate.decode(data, 'der');
-
-    var tbs = res.tbsCertificate;
-    assert.equal(tbs.version, 'v3');
-    assert.deepEqual(tbs.serialNumber,
-                     new asn1.bignum('462e4256bb1194dc', 16));
-    assert.equal(tbs.signature.algorithm.join('.'),
-                 '1.2.840.113549.1.1.5');
-    assert.equal(tbs.signature.parameters.toString('hex'), '0500');
-  });
-  it('should decode ECC Certificate', function() {
-/*
-  Symantec Class 3 ECC 256 bit Extended Validation CA from
-  https://knowledge.symantec.com/support/ssl-certificates-support/index?page=content&actp=CROSSLINK&id=AR1908
-*/
-    var data = new Buffer(
-      '308203e33082036aa00302010202104d955d20af85c49f6925fbab7c665f89300a0608' +
-      '2a8648ce3d0403033081ca310b300906035504061302555331173015060355040a130e' +
-      '566572695369676e2c20496e632e311f301d060355040b1316566572695369676e2054' +
-      '72757374204e6574776f726b313a3038060355040b1331286329203230303720566572' +
-      '695369676e2c20496e632e202d20466f7220617574686f72697a656420757365206f6e' +
-      '6c79314530430603550403133c566572695369676e20436c6173732033205075626c69' +
-      '63205072696d6172792043657274696669636174696f6e20417574686f72697479202d' +
-      '204734301e170d3132313232303030303030305a170d3232313231393233353935395a' +
-      '30818b310b3009060355040613025553311d301b060355040a131453796d616e746563' +
-      '20436f72706f726174696f6e311f301d060355040b131653796d616e74656320547275' +
-      '7374204e6574776f726b313c303a0603550403133353796d616e74656320436c617373' +
-      '203320454343203235362062697420457874656e6465642056616c69646174696f6e20' +
-      '43413059301306072a8648ce3d020106082a8648ce3d03010703420004dd043db2f290' +
-      '9397c6e9bbbc91db51f0a386edfbc6d38593320549e00483619651ff5721ae0bda0ee7' +
-      '04a17fdb2a1cbdca9835c5717340cde86aab54844326e2a382016d3082016930120603' +
-      '551d130101ff040830060101ff02010030370603551d1f0430302e302ca02aa0288626' +
-      '687474703a2f2f63726c2e77732e73796d616e7465632e636f6d2f706361332d67342e' +
-      '63726c300e0603551d0f0101ff040403020106303706082b06010505070101042b3029' +
-      '302706082b06010505073001861b687474703a2f2f6f6373702e77732e73796d616e74' +
-      '65632e636f6d30650603551d20045e305c305a0604551d20003052302606082b060105' +
-      '05070201161a687474703a2f2f7777772e73796d617574682e636f6d2f637073302806' +
-      '082b06010505070202301c1a1a687474703a2f2f7777772e73796d617574682e636f6d' +
-      '2f727061302a0603551d1104233021a41f301d311b30190603550403131253594d432d' +
-      '4543432d43412d703235362d33301d0603551d0e041604144813651794ec9e162a2a74' +
-      '5ce8532db4fb83eb8e301f0603551d23041830168014b31691fdeea66ee4b52e498f87' +
-      '788180ece5b1b5300a06082a8648ce3d040303036700306402305c9bee83a3764d8c2d' +
-      '054c8234bab3bece8fe8c33481fb4077e8346c5b172b3badd5a7a3d2f366c24fb2b0c8' +
-      '76988fbf02304fc22fce92c5a9bdce7d4ed41b3b6624ea4ecd82af544a88efe3bf3a93' +
-      '6354217d1230d232cdabc981b0a711437b4566',
-      'hex');
-    var SubjectPublicKeyInfo = rfc3280.SubjectPublicKeyInfo;
-    var res = rfc3280.Certificate.decode(data, 'der');
-
-    var tbs = res.tbsCertificate;
-    assert.equal(tbs.version, 'v3');
-    assert.deepEqual(tbs.serialNumber,
-                     new asn1.bignum('4d955d20af85c49f6925fbab7c665f89', 16));
-    assert.equal(tbs.signature.algorithm.join('.'),
-                 '1.2.840.10045.4.3.3');  // RFC5754
-    var spki = SubjectPublicKeyInfo.encode(tbs.subjectPublicKeyInfo, 'der');
-// spki check to the output of
-// openssl x509 -in ecc_cert.pem -pubkey -noout |
-// openssl pkey -pubin  -outform der | openssl base64
-    assert.equal(spki.toString('base64'),
-                 'MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE3QQ9svKQk5fG6bu8kdtR8KO' +
-                 'G7fvG04WTMgVJ4ASDYZZR/1chrgvaDucEoX/bKhy9ypg1xXFzQM3oaqtUhE' +
-                 'Mm4g=='
-                );
-  });
-
-  it('should decode AuthorityInfoAccess', function() {
-    var data = new Buffer('305a302b06082b06010505073002861f687474703a2f2f70' +
-                          '6b692e676f6f676c652e636f6d2f47494147322e63727430' +
-                          '2b06082b06010505073001861f687474703a2f2f636c6965' +
-                          '6e7473312e676f6f676c652e636f6d2f6f637370',
-                          'hex');
-
-    var info = rfc3280.AuthorityInfoAccessSyntax.decode(data, 'der');
-
-    assert(info[0].accessMethod);
-  });
-
-  it('should decode directoryName in GeneralName', function() {
-    var data = new Buffer('a411300f310d300b06022a03160568656c6c6f', 'hex');
-
-    var name = rfc3280.GeneralName.decode(data, 'der');
-    assert.equal(name.type, 'directoryName');
-  });
-});

-- 
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