Skip to content

Commit

Permalink
fix: Set id of initial session key to that of identity key
Browse files Browse the repository at this point in the history
As a workaround for #26
  • Loading branch information
gnarea committed Nov 16, 2020
1 parent ddae17b commit 1439048
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/bin/generate-keypairs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ async function main(): Promise<void> {
subjectPublicKey: initialSessionKeyPair.publicKey,
validityEndDate: sessionCertEndDate,
});
// Force the certificate to have the serial number specified in ENDPOINT_KEY_ID. This nasty
// hack won't be necessary once https://github.com/relaycorp/relaynet-pong/issues/26 is done.
// tslint:disable-next-line:no-object-mutation
(initialKeyCertificate as any).pkijsCertificate.serialNumber.valueBlock.valueHex = bufferToArray(
endpointKeyId,
);
await sessionStore.saveInitialSessionKey(initialSessionKeyPair.privateKey, initialKeyCertificate);

console.log(
Expand Down

0 comments on commit 1439048

Please sign in to comment.