Skip to content

Commit

Permalink
fix: Migrate OID to one assigned to Relaycorp, Inc. by IANA (#503)
Browse files Browse the repository at this point in the history
Replacing the one assigned to Relaycorp, Ltd. in the UK.
  • Loading branch information
gnarea authored Aug 16, 2022
1 parent ac6e5de commit eb268d3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions src/lib/crypto_wrappers/cms/envelopedData.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import { assertPkiType } from './_utils';

const OID_SHA256 = '2.16.840.1.101.3.4.2.1';
const OID_RSA_OAEP = '1.2.840.113549.1.1.7';
const OID_RELAYNET_ORIGINATOR_EPHEMERAL_CERT_SERIAL_NUMBER = '0.4.0.127.0.17.0.1.0';
const OID_AWALA_ORIGINATOR_EPHEMERAL_CERT_SERIAL_NUMBER = '1.3.6.1.4.1.58708.0.1.0';

const plaintext = arrayBufferFrom('Winter is coming');

Expand Down Expand Up @@ -322,7 +322,7 @@ describe('SessionEnvelopedData', () => {
)[0];
expect(dhKeyIdAttribute).toHaveProperty(
'type',
OID_RELAYNET_ORIGINATOR_EPHEMERAL_CERT_SERIAL_NUMBER,
OID_AWALA_ORIGINATOR_EPHEMERAL_CERT_SERIAL_NUMBER,
);
const dhKeyIdAttributeValue = (dhKeyIdAttribute as any).values[0];
expect(dhKeyIdAttributeValue).toBeInstanceOf(asn1js.OctetString);
Expand Down Expand Up @@ -396,7 +396,7 @@ describe('SessionEnvelopedData', () => {

test('Call should fail if attribute for originator key id is empty', async () => {
const invalidAttribute = new pkijs.Attribute({
type: OID_RELAYNET_ORIGINATOR_EPHEMERAL_CERT_SERIAL_NUMBER,
type: OID_AWALA_ORIGINATOR_EPHEMERAL_CERT_SERIAL_NUMBER,
values: [],
});
envelopedData.pkijsEnvelopedData.unprotectedAttrs = [invalidAttribute];
Expand All @@ -408,7 +408,7 @@ describe('SessionEnvelopedData', () => {

test('Call should fail if attribute for originator key id is multi-valued', async () => {
const invalidAttribute = new pkijs.Attribute({
type: OID_RELAYNET_ORIGINATOR_EPHEMERAL_CERT_SERIAL_NUMBER,
type: OID_AWALA_ORIGINATOR_EPHEMERAL_CERT_SERIAL_NUMBER,
values: [new asn1js.Integer({ value: 1 }), new asn1js.Integer({ value: 2 })],
});
envelopedData.pkijsEnvelopedData.unprotectedAttrs = [invalidAttribute];
Expand Down
12 changes: 6 additions & 6 deletions src/lib/oids.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@ export const CMS_OIDS = {
SIGNED_DATA: '1.2.840.113549.1.7.2',
};

//region Relaynet
const RELAYCORP = '0.4.0.127.0.17';
const RELAYNET = `${RELAYCORP}.0`;
//region Awala
const RELAYCORP = '1.3.6.1.4.1.58708'; // iso.org.dod.internet.private.enterprise.relaycorp
const AWALA = `${RELAYCORP}.0`;

const PRIVATE_NODE_REGISTRATION_PREFIX = `${RELAYNET}.2`;
const PRIVATE_NODE_REGISTRATION_PREFIX = `${AWALA}.2`;

const DETACHED_SIGNATURE_PREFIX = `${RELAYNET}.3`;
const DETACHED_SIGNATURE_PREFIX = `${AWALA}.3`;
export const RELAYNET_OIDS = {
NODE_REGISTRATION: {
AUTHORIZATION: `${PRIVATE_NODE_REGISTRATION_PREFIX}.0`,
AUTHORIZATION_COUNTERSIGNATURE: `${PRIVATE_NODE_REGISTRATION_PREFIX}.1`,
},
ORIGINATOR_EPHEMERAL_CERT_SERIAL_NUMBER: `${RELAYNET}.1.0`,
ORIGINATOR_EPHEMERAL_CERT_SERIAL_NUMBER: `${AWALA}.1.0`,
SIGNATURE: {
PARCEL_COLLECTION_HANDSHAKE: `${DETACHED_SIGNATURE_PREFIX}.1`,
PARCEL_DELIVERY: `${DETACHED_SIGNATURE_PREFIX}.0`,
Expand Down

0 comments on commit eb268d3

Please sign in to comment.