diff --git a/packages/backend/src/nest/common/client-server.ts b/packages/backend/src/nest/common/client-server.ts index 71e22c4728..b94f8f0b2c 100644 --- a/packages/backend/src/nest/common/client-server.ts +++ b/packages/backend/src/nest/common/client-server.ts @@ -9,7 +9,6 @@ export const createUsersCerts = async ( nickname: 'dev99damian1', commonName: onion, peerId: 'Qmf3ySkYqLET9xtAtDzvAr5Pp3egK1H3C5iJAZm1SpLert', - dmPublicKey: 'dmPublicKey1', signAlg: configCrypto.signAlg, hashAlg: configCrypto.hashAlg, } diff --git a/packages/backend/src/nest/registration/registration.service.spec.ts b/packages/backend/src/nest/registration/registration.service.spec.ts index fbaa2a6191..1ccbcf4dd1 100644 --- a/packages/backend/src/nest/registration/registration.service.spec.ts +++ b/packages/backend/src/nest/registration/registration.service.spec.ts @@ -46,7 +46,6 @@ describe('RegistrationService', () => { nickname: 'userName', commonName: 'nqnw4kc4c77fb47lk52m5l57h4tcxceo7ymxekfn7yh5m66t4jv2olad.onion', peerId: 'Qmf3ySkYqLET9xtAtDzvAr5Pp3egK1H3C5iJAZm1SpLEp6', - dmPublicKey: 'testdmPublicKey', signAlg: configCrypto.signAlg, hashAlg: configCrypto.hashAlg, }) @@ -88,7 +87,6 @@ describe('RegistrationService', () => { nickname: 'alice', commonName: 'nqnw4kc4c77fb47lk52m5l57h4tcxceo7ymxekfn7yh5m66t4jv2olad.onion', peerId: 'Qmf3ySkYqLET9xtAtDzvAr5Pp3egK1H3C5iJAZm1SpLEp6', - dmPublicKey: 'testdmPublicKey', signAlg: configCrypto.signAlg, hashAlg: configCrypto.hashAlg, }) @@ -122,7 +120,6 @@ describe('RegistrationService', () => { nickname: 'userName2', commonName: 'nqnw4kc4c77fb47lk52m5l57h4tcxceo7ymxekfn7yh5m66t4jv2olad.onion', peerId: 'Qmf3ySkYqLET9xtAtDzvAr5Pp3egK1H3C5iJAZm1SpLEp6', - dmPublicKey: 'testdmPublicKey', signAlg: configCrypto.signAlg, hashAlg: configCrypto.hashAlg, }) @@ -136,7 +133,6 @@ describe('RegistrationService', () => { nickname: 'karol', commonName: 'nqnw4kc4c77fb47lk52m5l57h4tcxceo7ymxekfn7yh5m66t4jv2olad.onion', peerId: 'Qmf3ySkYqLET9xtAtDzvAr5Pp3egK1H3C5iJAZm1SpLEp6', - dmPublicKey: 'testdmPublicKey', signAlg: configCrypto.signAlg, hashAlg: configCrypto.hashAlg, }) @@ -144,7 +140,6 @@ describe('RegistrationService', () => { nickname: 'karol', commonName: 'nnnnnnc4c77fb47lk52m5l57h4tcxceo7ymxekfn7yh5m66t4jv2olad.onion', peerId: 'QmffffffqLET9xtAtDzvAr5Pp3egK1H3C5iJAZm1SpLEp6', - dmPublicKey: 'testdmPublicKey', signAlg: configCrypto.signAlg, hashAlg: configCrypto.hashAlg, }) @@ -187,7 +182,6 @@ describe('RegistrationService', () => { nickname: 'alice', commonName: 'nqnw4kc4c77fb47lk52m5l57h4tcxceo7ymxekfn7yh5m66t4jv2olad.onion', peerId: 'Qmf3ySkYqLET9xtAtDzvAr5Pp3egK1H3C5iJAZm1SpLEp6', - dmPublicKey: 'testdmPublicKey', signAlg: configCrypto.signAlg, hashAlg: configCrypto.hashAlg, }) @@ -196,7 +190,6 @@ describe('RegistrationService', () => { nickname: 'alice', commonName: 'nnnnnnc4c77fb47lk52m5l57h4tcxceo7ymxekfn7yh5m66t4jv2olad.onion', peerId: 'QmffffffqLET9xtAtDzvAr5Pp3egK1H3C5iJAZm1SpLEp6', - dmPublicKey: 'testdmPublicKey', signAlg: configCrypto.signAlg, hashAlg: configCrypto.hashAlg, }) diff --git a/packages/backend/src/nest/storage/storage.service.spec.ts b/packages/backend/src/nest/storage/storage.service.spec.ts index 0cfdef6888..fa65bcd37b 100644 --- a/packages/backend/src/nest/storage/storage.service.spec.ts +++ b/packages/backend/src/nest/storage/storage.service.spec.ts @@ -525,15 +525,11 @@ describe('StorageService', () => { { onionAddress: '6vu2bxki777it3cpayv6fq6vpl4ke3kzj7gxicfygm55dhhtphyfdvyd.onion', peerId: 'QmXRY4rhAx8Muq8dMGkr9qknJdE6UHZDdGaDRTQEbwFN5b', - dmPublicKey: - '299abdb3a1c456245fa65560624ba583a5d5e35d5945ee14d548df5d37f5a516b281f71e9c66d3e9145a80fb59ce3baae611dd621a838d1cd98676e7f1901261380133ba9cb1e52ae54a52d69134f032368de3caa9ab69dcfce6e9afcc192ce21129d1131efce0994a7f028c8c9977dd403c9509bd9e149e0081f2071ddce0b7fc217756da7deb9e16d57e3a41300c7087a96df9ee5a82d197cbeabfc4011251e2cf7d481161672d94b82df0ea7e593a4bc81919b1516806f26b32dd9774cd11237d98cd346be7a19715ae15c90998e715f095048f8227403fb8cf915ca035ca1e5ef033d990a4dc84750a7de65fc9cc928e773250cd68c625754400d2e836f3f4bb0654a56aad820c3e0e977b304eaec2e0a193c4aac8dfaaee614671ecd11a40317957b56fa8f099d1f6684c826e4984d0ebb8', username: 'o', }, { onionAddress: 'y7yczmugl2tekami7sbdz5pfaemvx7bahwthrdvcbzw5vex2crsr26qd.onion', peerId: 'QmT18UvnUBkseMc3SqnfPxpHwN8nzLrJeNSLZtc8rAFXhz', - dmPublicKey: - '050bf2be48a25c47ff3cb2a7b11d416bd02162c54ef28e7a6e77ed527a15cc19516605332c9bce4aba0f93f1266d5cfea2484cadc60d802587bf1ac0a87555ab42513fa6e2f7c06d094a2dc7a38f147a792b94022fad21a1dd6e02784aa1cc891bdb6ca0cf5a4be92b9ff93e83844206388f676e5c0bb406fd436beb0c8843c7a5061a3830a9bc88ea7b112852b19395d5feb1ae75d8082ff3c9473ce4612ec9c2f35489a0010bcf0136dd333638cd21a734b1f192f494371691f4b9c459ffa2d637aa70e8973af99dc94e417b766a8462afbc183fe6fc8b4220887de6a98d97a69cba851d0062b609439b6c6728be87cccc9f6680073d5ed8716611e2ca54f49bbc43c6aa49e02bcb1eecc79e5e491e063b95104e8e43ad09fac6d930399ff2b6c3a49c5b6117c8dc03db9300c0ca0364f29425', username: 'o', }, ]) diff --git a/packages/backend/src/nest/storage/storage.service.ts b/packages/backend/src/nest/storage/storage.service.ts index 54d7a65b0a..1d9ba7eafe 100644 --- a/packages/backend/src/nest/storage/storage.service.ts +++ b/packages/backend/src/nest/storage/storage.service.ts @@ -738,9 +738,8 @@ export class StorageService extends EventEmitter { const onionAddress = getReqFieldValue(parsedCert, CertFieldsTypes.commonName) const peerId = getReqFieldValue(parsedCert, CertFieldsTypes.peerId) const username = getReqFieldValue(parsedCert, CertFieldsTypes.nickName) - const dmPublicKey = getReqFieldValue(parsedCert, CertFieldsTypes.dmPublicKey) - if (!onionAddress || !peerId || !username || !dmPublicKey) continue - allUsers.push({ onionAddress, peerId, username, dmPublicKey }) + if (!onionAddress || !peerId || !username) continue + allUsers.push({ onionAddress, peerId, username }) } return allUsers } diff --git a/packages/desktop/src/renderer/components/Channel/Channel.stories.cy.tsx b/packages/desktop/src/renderer/components/Channel/Channel.stories.cy.tsx index 0a302125e0..b9c82b83be 100644 --- a/packages/desktop/src/renderer/components/Channel/Channel.stories.cy.tsx +++ b/packages/desktop/src/renderer/components/Channel/Channel.stories.cy.tsx @@ -66,10 +66,6 @@ const Template: ComponentStory = () => { privKey: 'privKey', pubKey: 'pubKey', }, - dmKeys: { - publicKey: 'publicKey', - privateKey: 'privateKey', - }, userCsr: { userCsr: 'userCsr', userKey: 'userKey', diff --git a/packages/desktop/src/renderer/components/Channel/Channel.stories.tsx b/packages/desktop/src/renderer/components/Channel/Channel.stories.tsx index 36593326c1..948bfc678a 100644 --- a/packages/desktop/src/renderer/components/Channel/Channel.stories.tsx +++ b/packages/desktop/src/renderer/components/Channel/Channel.stories.tsx @@ -25,10 +25,6 @@ const args: Partial = { privKey: 'privKey', pubKey: 'pubKey', }, - dmKeys: { - publicKey: 'publicKey', - privateKey: 'privateKey', - }, userCsr: { userCsr: 'userCsr', userKey: 'userKey', diff --git a/packages/identity/src/common.ts b/packages/identity/src/common.ts index 3b6f828e0b..8aded82d0d 100644 --- a/packages/identity/src/common.ts +++ b/packages/identity/src/common.ts @@ -9,7 +9,6 @@ export enum CertFieldsTypes { subjectAltName = '2.5.29.17', nickName = '1.3.6.1.4.1.50715.2.1', peerId = '1.3.6.1.2.1.15.3.1.1', - dmPublicKey = '1.2.840.113549.1.9.12', } export enum ExtensionsTypes { @@ -100,17 +99,9 @@ export const getCertFieldValue = (cert: Certificate, fieldType: CertFieldsTypes } else { const ext = cert.extensions?.find(tav => tav.extnID === fieldType) if (ext) { - if (fieldType === CertFieldsTypes.dmPublicKey) { - const extObj = ext?.extnValue.valueBlock.value[0] - // @ts-ignore - const arrayBuffer = extObj.valueBlock.valueHex - - return arrayBufferToHexString(arrayBuffer) - } else { - const extObj = ext?.extnValue.valueBlock.value[0] - // @ts-ignore - return extObj.valueBlock.value - } + const extObj = ext?.extnValue.valueBlock.value[0] + // @ts-ignore + return extObj.valueBlock.value } else { return null } @@ -131,12 +122,7 @@ export const getReqFieldValue = ( } else { const ext = csr.attributes?.find(tav => tav.type === fieldType) if (ext) { - if (fieldType === CertFieldsTypes.dmPublicKey) { - const extObj = ext.values[0].valueBlock.valueHex - return arrayBufferToHexString(extObj) - } else { - return ext.values[0].valueBlock.value - } + return ext.values[0].valueBlock.value } else { return null } diff --git a/packages/identity/src/createUserCert.ts b/packages/identity/src/createUserCert.ts index d8e53b4837..05a3bce74b 100644 --- a/packages/identity/src/createUserCert.ts +++ b/packages/identity/src/createUserCert.ts @@ -69,14 +69,12 @@ async function generateUserCertificate({ ], }) const attr: Attribute[] | undefined = pkcs10.attributes - let dmPubKey = null let nickname = null let peerId = null let onionAddress = null let altNames try { - dmPubKey = attr?.[1].values[0].valueBlock.valueHex nickname = attr?.[2].values[0].valueBlock.value peerId = attr?.[3].values[0].valueBlock.value onionAddress = attr?.[4].values[0].valueBlock.value @@ -114,11 +112,6 @@ async function generateUserCertificate({ extnValue: extKeyUsage.toSchema().toBER(false), parsedValue: extKeyUsage, // Parsed value for well-known extensions }), - new Extension({ - extnID: CertFieldsTypes.dmPublicKey, - critical: false, - extnValue: new OctetString({ valueHex: dmPubKey }).toBER(false), - }), new Extension({ extnID: CertFieldsTypes.nickName, critical: false, diff --git a/packages/identity/src/createUserCsr.ts b/packages/identity/src/createUserCsr.ts index eee73dbc27..8276d262ef 100644 --- a/packages/identity/src/createUserCsr.ts +++ b/packages/identity/src/createUserCsr.ts @@ -20,13 +20,11 @@ export const createUserCsr = async ({ nickname, commonName, peerId, - dmPublicKey, existingKeyPair, }: { nickname: string commonName: string peerId: string - dmPublicKey: string signAlg: string hashAlg: string existingKeyPair?: CryptoKeyPair @@ -35,7 +33,6 @@ export const createUserCsr = async ({ nickname, commonName, peerId, - dmPublicKey, signAlg: config.signAlg, hashAlg: config.hashAlg, existingKeyPair, @@ -59,7 +56,6 @@ async function requestCertificate({ nickname, commonName, peerId, - dmPublicKey, signAlg = config.signAlg, hashAlg = config.hashAlg, existingKeyPair, @@ -67,14 +63,12 @@ async function requestCertificate({ nickname: string commonName: string peerId: string - dmPublicKey: string signAlg: string hashAlg: string existingKeyPair?: CryptoKeyPair }): Promise { const keyPair: CryptoKeyPair = existingKeyPair ? existingKeyPair : await generateKeyPair({ signAlg }) - const arrayBufferDmPubKey = hexStringToArrayBuffer(dmPublicKey) const pkcs10 = new CertificationRequest({ version: 0, @@ -110,10 +104,6 @@ async function requestCertificate({ }).toSchema(), ], }), - new Attribute({ - type: CertFieldsTypes.dmPublicKey, - values: [new OctetString({ valueHex: arrayBufferDmPubKey })], - }), new Attribute({ type: CertFieldsTypes.nickName, values: [new PrintableString({ value: nickname })], diff --git a/packages/identity/src/test/helpers.ts b/packages/identity/src/test/helpers.ts index 68760bfbb8..b663df43d2 100644 --- a/packages/identity/src/test/helpers.ts +++ b/packages/identity/src/test/helpers.ts @@ -9,7 +9,6 @@ export const userData = { nickname: 'userName', commonName: 'nqnw4kc4c77fb47lk52m5l57h4tcxceo7ymxekfn7yh5m66t4jv2olad.onion', peerId: 'Qmf3ySkYqLET9xtAtDzvAr5Pp3egK1H3C5iJAZm1SpLEp6', - dmPublicKey: '0bfb475810c0e26c9fab590d47c3d60ec533bb3c451596acc3cd4f21602e9ad9', signAlg: config.signAlg, hashAlg: config.hashAlg, } @@ -62,7 +61,6 @@ export const createUserCertificateTestHelper = async ( nickname: string commonName: string peerId: string - dmPublicKey: string }, rootCA?: Pick | null ): Promise<{ @@ -73,7 +71,6 @@ export const createUserCertificateTestHelper = async ( nickname: user.nickname, commonName: user.commonName, peerId: user.peerId, - dmPublicKey: user.dmPublicKey, signAlg: config.signAlg, hashAlg: config.hashAlg, }) diff --git a/packages/identity/src/test/index.test.ts b/packages/identity/src/test/index.test.ts index 23a1f69dfb..b6af8010ea 100644 --- a/packages/identity/src/test/index.test.ts +++ b/packages/identity/src/test/index.test.ts @@ -87,7 +87,6 @@ describe('Certificate', () => { [CertFieldsTypes.commonName]: userData.commonName, [CertFieldsTypes.nickName]: userData.nickname, [CertFieldsTypes.peerId]: userData.peerId, - [CertFieldsTypes.dmPublicKey]: userData.dmPublicKey, } type CertFieldsTypesKeys = keyof typeof certTypeData @@ -107,7 +106,6 @@ describe('Certificate', () => { [CertFieldsTypes.commonName]: userData.commonName, [CertFieldsTypes.nickName]: userData.nickname, [CertFieldsTypes.peerId]: userData.peerId, - [CertFieldsTypes.dmPublicKey]: userData.dmPublicKey, } type CertFieldsTypesKeys = keyof typeof certTypeData @@ -126,7 +124,6 @@ describe('Certificate', () => { 'MIIB7TCCAZMCBgF641h5xzAKBggqhkjOPQQDAjASMRAwDgYDVQQDEwdaYmF5IENBMB4XDTIxMDcyNjE1MDQyNFoXDTMwMDIwMTAwMDAwMFowgc4xgcswHAYKKwYBBAGDjBsCARMOZGV2OTlkZXY5OXlvZGEwPwYDVQQDEzgzNWNzNmZramJoZmJiMnppYnIzNm5rdXY0cWlld2x2NXBmcGprbHh2N2xtcGphM2hydTN3NDdpZDA7BgkrBgECAQ8DAQETLlFtVmIxbUZ2Z1hKZXRKS0o1NmRtR1Q2Rkd1TnJtM0VhVFZ6V3VHaGtxcjZodjUwLQYJKoZIhvcNAQkMBCCf3wijnripB3ZADnDgT1ZIr1zUGjHVZI2K4kt6Yb7CazBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABDKw/zcoE2Vahw3q9CdRQsCXikFU8PhEIN/y65hrB6yAxWH4Ut9QBKMMAnaG8JlzvEeaScQiu5Jyyx0O0xAadQ+jHTAbMAwGA1UdEwQFMAMCAQMwCwYDVR0PBAQDAgAGMAoGCCqGSM49BAMCA0gAMEUCIQCRz+6W3K3SI7Q7uYDVVIJXnWud/DGvpqHCuLJ+gnJLMgIgBmS1D8s1xnGOQpARx40vus4b/f49LQeG2YxPCSHVQOM=' ) - expect(getCertFieldValue(parsedCert, CertFieldsTypes.dmPublicKey)).toEqual(null) expect(getCertFieldValue(parsedCert, CertFieldsTypes.subjectAltName)).toEqual(null) expect(getCertFieldValue(parsedCert, CertFieldsTypes.peerId)).toEqual(null) expect(getCertFieldValue(parsedCert, CertFieldsTypes.nickName)).toEqual(null) diff --git a/packages/mobile/src/components/Registration/UsernameRegistration.test.tsx b/packages/mobile/src/components/Registration/UsernameRegistration.test.tsx index 057b535a23..4ec77eeedd 100644 --- a/packages/mobile/src/components/Registration/UsernameRegistration.test.tsx +++ b/packages/mobile/src/components/Registration/UsernameRegistration.test.tsx @@ -254,15 +254,11 @@ describe('UsernameRegistration', () => { currentUsername={'john'} registeredUsers={{ 'BCidRGCBqBPNGNrZ1oml99/qtHjZ6ZtliVzJPpReZk9YC6+aQ1zeooOlpyzv7rNG6nMX2R5ffaVkZZFgEMdNEBg=': { - dmPublicKey: - '1c63a0152f0b0221f96c80aab6777e2569d27a14e991dccd086e34cda1c55d9d6e898efdb9cb5a16d2f90b4155e34abf3261c84e76936ba0105929922feda1fb0615f3254cc56c056cb6144076d0cbdba67cf0fb6687a97d9bb6621bb6b38dcf08aa509f1164212118111f045edc5dab8d315d6e1241cdd10c40883ea420d10d560e48329e086154645035af0668e372a381fbd8aa0912f3581de34b50361cc31adf7a8e811504b6970c9093c058f0fb41ae27df64b09bcb13df84bd23d47a0024463cbb92ee917af3b77b168deb93f6da2d0d13a361969447e16bf249edd872b4797125fa86aad1ce35b1d6ee449359f31c9224a70997d0f0ca38c1f796cede660dd0bb3b1fc9ec251f896bc0aec1603ee8e1278c76d9d1e52adcfa0a06658d631486016efb3b5f44e0c3fb1ce4299834cdf05e', onionAddress: 'zpu47hphczcuyt3auu5pr2knvimf3adm76gt3g7zbspungjbm3tsy3ad.onion', peerId: 'QmPrgB2jSFvr7yP3vbLKMLW4JS9hoA9kj2fhN8VjE2NWvJ', username: 'owner', }, 'BJ50trLih9tvIznBAi69dLNpBV5YiQHCU610UfH3Qm9t3cki9QHWAAhvrfOX+763BH1fwqkOU3JsoBAEF1+USvM=': { - dmPublicKey: - '01161f217d3b372ddefe390b6aed6ada3f21c7ca0d2aacd125840d0c420030b5caec93fbcc1825bb19f38448c1573be814c827b3bce99f6d37b427044687b63799ce0cd7133a654eb2c5644405380399ed0b9140cf0f6d2937008929be8c8ad97cba64e08f7608bb54e0148c8bb30fd2c6df2b8d237cdbfe7ae3d300d896c0ce9e3c5006b687f2e573bedb68152db1954869c21243ef1557eb6d442138ad98e47285f5dd9475fac3a06d2972ae775bdc50d5ab59676d27367c15954b64b0b1a29083ac78934f3f1d0088b73389e29d84f61c60c321770550ecdffa9a24cf0c7fdd279974b5703ce105f22d683530c2f62b36945b3d97f88256f31e1146c3861993a989f5cd99bda647d8744068c3bb44eea407f33109c9c1a0f790f745a6ff2bfd45f5be741fc351549b11d54a4980c4d6d7afb4', onionAddress: 'lr5d3d64p4hx4mw3uue3ufews23jhl6bfqnsimt7j52igjqdv2zrmsyd.onion', peerId: 'QmWwMev68izPUKB1PGxkG3UHHXiappQQAnkvUwPSTzrUyy', username: 'johnny', @@ -438,7 +434,7 @@ describe('UsernameRegistration', () => { verticalTextAlign="center" > We’re sorry, but the username - + { } verticalTextAlign="center" > - Your username will be public, but you can choose any name you like. No spaces or special characters. Lowercase letters and numbers only. + Your username will be public, but you can choose any name you like. No spaces or special characters. Lowercase letters and numbers only. { username: alice.nickname, onionAddress: alice.hiddenService.onionAddress, peerId: alice.peerId.id, - dmPublicKey: alice.dmKeys.publicKey, isDuplicated: false, isRegistered: true, pubKey, diff --git a/packages/state-manager/src/sagas/communities/createNetwork/createNetwork.saga.ts b/packages/state-manager/src/sagas/communities/createNetwork/createNetwork.saga.ts index ed84a06819..d0731f997b 100644 --- a/packages/state-manager/src/sagas/communities/createNetwork/createNetwork.saga.ts +++ b/packages/state-manager/src/sagas/communities/createNetwork/createNetwork.saga.ts @@ -63,7 +63,6 @@ export function* createNetworkSaga( nickname: '', hiddenService: network.hiddenService, peerId: network.peerId, - dmKeys, userCsr: null, userCertificate: null, joinTimestamp: null, diff --git a/packages/state-manager/src/sagas/identity/checkLocalCsr/checkLocalCsr.saga.test.ts b/packages/state-manager/src/sagas/identity/checkLocalCsr/checkLocalCsr.saga.test.ts index 160e6ec004..7804f2fc5c 100644 --- a/packages/state-manager/src/sagas/identity/checkLocalCsr/checkLocalCsr.saga.test.ts +++ b/packages/state-manager/src/sagas/identity/checkLocalCsr/checkLocalCsr.saga.test.ts @@ -61,7 +61,6 @@ describe('checkLocalCsr', () => { nickname: 'alice', commonName: identity.hiddenService.onionAddress, peerId: identity.peerId.id, - dmPublicKey: identity.dmKeys.publicKey, signAlg: 'ECDSA', hashAlg: 'sha-256', existingKeyPair, diff --git a/packages/state-manager/src/sagas/identity/identity.types.ts b/packages/state-manager/src/sagas/identity/identity.types.ts index 31bd088788..31420aa396 100644 --- a/packages/state-manager/src/sagas/identity/identity.types.ts +++ b/packages/state-manager/src/sagas/identity/identity.types.ts @@ -10,11 +10,6 @@ export interface UserCsr { pkcs10: CertData } -export interface CreateDmKeyPairPayload { - dmPublicKey: string - dmPrivateKey: string -} - export interface HiddenService { onionAddress: string privateKey: string @@ -26,16 +21,10 @@ export interface PeerId { privKey?: string } -export interface DmKeys { - publicKey: string - privateKey: string -} - export interface Identity { id: string nickname: string hiddenService: HiddenService - dmKeys: DmKeys peerId: PeerId userCsr: UserCsr | null userCertificate: string | null @@ -46,7 +35,6 @@ export interface CreateUserCsrPayload { nickname: string commonName: string peerId: string - dmPublicKey: string signAlg: string hashAlg: string } diff --git a/packages/state-manager/src/sagas/identity/registerUsername/registerUsername.saga.test.ts b/packages/state-manager/src/sagas/identity/registerUsername/registerUsername.saga.test.ts index 112d724cd1..5acf2b3e7b 100644 --- a/packages/state-manager/src/sagas/identity/registerUsername/registerUsername.saga.test.ts +++ b/packages/state-manager/src/sagas/identity/registerUsername/registerUsername.saga.test.ts @@ -48,7 +48,6 @@ describe('registerUsernameSaga', () => { nickname: 'nickname', commonName: identity.hiddenService.onionAddress, peerId: identity.peerId.id, - dmPublicKey: identity.dmKeys.publicKey, signAlg: config.signAlg, hashAlg: config.hashAlg, } @@ -105,7 +104,6 @@ describe('registerUsernameSaga', () => { nickname: newNickname, commonName: identity.hiddenService.onionAddress, peerId: identity.peerId.id, - dmPublicKey: identity.dmKeys.publicKey, signAlg: config.signAlg, hashAlg: config.hashAlg, existingKeyPair: { @@ -247,7 +245,6 @@ describe('registerUsernameSaga', () => { nickname: 'nickname', commonName: identity.hiddenService.onionAddress, peerId: identity.peerId.id, - dmPublicKey: identity.dmKeys.publicKey, signAlg: config.signAlg, hashAlg: config.hashAlg, } diff --git a/packages/state-manager/src/sagas/identity/registerUsername/registerUsername.saga.ts b/packages/state-manager/src/sagas/identity/registerUsername/registerUsername.saga.ts index 6899f03c21..4622539f7f 100644 --- a/packages/state-manager/src/sagas/identity/registerUsername/registerUsername.saga.ts +++ b/packages/state-manager/src/sagas/identity/registerUsername/registerUsername.saga.ts @@ -54,7 +54,6 @@ export function* registerUsernameSaga( nickname, commonName: identity.hiddenService.onionAddress, peerId: identity.peerId.id, - dmPublicKey: identity.dmKeys.publicKey, signAlg: config.signAlg, hashAlg: config.hashAlg, existingKeyPair, @@ -71,7 +70,6 @@ export function* registerUsernameSaga( nickname, commonName: identity.hiddenService.onionAddress, peerId: identity.peerId.id, - dmPublicKey: identity.dmKeys.publicKey, signAlg: config.signAlg, hashAlg: config.hashAlg, } diff --git a/packages/state-manager/src/sagas/publicChannels/deleteChannel/deleteChannel.saga.test.ts b/packages/state-manager/src/sagas/publicChannels/deleteChannel/deleteChannel.saga.test.ts index ac250d9ec4..4b9e0f15fd 100644 --- a/packages/state-manager/src/sagas/publicChannels/deleteChannel/deleteChannel.saga.test.ts +++ b/packages/state-manager/src/sagas/publicChannels/deleteChannel/deleteChannel.saga.test.ts @@ -38,7 +38,6 @@ describe('deleteChannelSaga', () => { username: string | null onionAddress: string | null peerId: string | null - dmPublicKey: string | null pubKey: string } | null diff --git a/packages/state-manager/src/sagas/publicChannels/publicChannels.selectors.test.ts b/packages/state-manager/src/sagas/publicChannels/publicChannels.selectors.test.ts index f392b997f3..b7e92e8272 100644 --- a/packages/state-manager/src/sagas/publicChannels/publicChannels.selectors.test.ts +++ b/packages/state-manager/src/sagas/publicChannels/publicChannels.selectors.test.ts @@ -260,7 +260,6 @@ describe('publicChannelsSelectors', () => { const displayable: Record = {} for (const message of Object.values(msgs)) { const user: User = { - dmPublicKey: '', isDuplicated: false, isRegistered: true, onionAddress: '', diff --git a/packages/state-manager/src/sagas/users/const/certFieldTypes.ts b/packages/state-manager/src/sagas/users/const/certFieldTypes.ts index 161e0dc7f8..da39a0c858 100644 --- a/packages/state-manager/src/sagas/users/const/certFieldTypes.ts +++ b/packages/state-manager/src/sagas/users/const/certFieldTypes.ts @@ -3,7 +3,6 @@ export enum CertFieldsTypes { subjectAltName = '2.5.29.17', nickName = '1.3.6.1.4.1.50715.2.1', peerId = '1.3.6.1.2.1.15.3.1.1', - dmPublicKey = '1.2.840.113549.1.9.12', } export const config = { diff --git a/packages/state-manager/src/sagas/users/userProfile/saveUserProfile.saga.test.ts b/packages/state-manager/src/sagas/users/userProfile/saveUserProfile.saga.test.ts index 3317097d7b..fc363a5753 100644 --- a/packages/state-manager/src/sagas/users/userProfile/saveUserProfile.saga.test.ts +++ b/packages/state-manager/src/sagas/users/userProfile/saveUserProfile.saga.test.ts @@ -28,7 +28,6 @@ describe('saveUserProfileSaga', () => { nickname: '', commonName: '', peerId: '', - dmPublicKey: '', signAlg: '', hashAlg: '', }) diff --git a/packages/state-manager/src/sagas/users/userProfile/userProfile.selectors.test.ts b/packages/state-manager/src/sagas/users/userProfile/userProfile.selectors.test.ts index 02b7a66576..4159216e1d 100644 --- a/packages/state-manager/src/sagas/users/userProfile/userProfile.selectors.test.ts +++ b/packages/state-manager/src/sagas/users/userProfile/userProfile.selectors.test.ts @@ -23,7 +23,6 @@ describe('user profile selectors', () => { nickname: '', commonName: '', peerId: '', - dmPublicKey: '', signAlg: '', hashAlg: '', }) diff --git a/packages/state-manager/src/sagas/users/users.selectors.test.ts b/packages/state-manager/src/sagas/users/users.selectors.test.ts index 50af782c63..edc7fb8671 100644 --- a/packages/state-manager/src/sagas/users/users.selectors.test.ts +++ b/packages/state-manager/src/sagas/users/users.selectors.test.ts @@ -23,7 +23,6 @@ describe('users selectors', () => { let alicePublicKey: string const aliceCertificateData = { - dmPublicKey: '0bfb475810c0e26c9fab590d47c3d60ec533bb3c451596acc3cd4f21602e9ad9', onionAddress: 'nqnw4kc4c77fb47lk52m5l57h4tcxceo7ymxekfn7yh5m66t4jv2olad.onion', peerId: 'Qmf3ySkYqLET9xtAtDzvAr5Pp3egK1H3C5iJAZm1SpLEp6', username: 'alice', @@ -49,10 +48,6 @@ describe('users selectors', () => { peerId: { id: aliceCertificateData.peerId, }, - dmKeys: { - publicKey: aliceCertificateData.dmPublicKey, - privateKey: '', - }, }) const parsedAliceCertificate = parseCertificate(alice.userCertificate!) @@ -82,7 +77,6 @@ describe('users selectors', () => { expect(usersData[alicePublicKey]).toMatchInlineSnapshot(` Object { - "dmPublicKey": "0bfb475810c0e26c9fab590d47c3d60ec533bb3c451596acc3cd4f21602e9ad9", "onionAddress": "nqnw4kc4c77fb47lk52m5l57h4tcxceo7ymxekfn7yh5m66t4jv2olad.onion", "peerId": "Qmf3ySkYqLET9xtAtDzvAr5Pp3egK1H3C5iJAZm1SpLEp6", "username": "alice", diff --git a/packages/state-manager/src/sagas/users/users.selectors.ts b/packages/state-manager/src/sagas/users/users.selectors.ts index d9e2abc656..2f21e34b08 100644 --- a/packages/state-manager/src/sagas/users/users.selectors.ts +++ b/packages/state-manager/src/sagas/users/users.selectors.ts @@ -29,7 +29,6 @@ export const certificatesMapping = createSelector(certificates, certs => { const username = getCertFieldValue(certificate, CertFieldsTypes.nickName) const onionAddress = getCertFieldValue(certificate, CertFieldsTypes.commonName) const peerId = getCertFieldValue(certificate, CertFieldsTypes.peerId) - const dmPublicKey = getCertFieldValue(certificate, CertFieldsTypes.dmPublicKey) || '' if (!username || !onionAddress || !peerId) { console.error(`Could not parse certificate for pubkey ${pubKey}`) @@ -40,7 +39,6 @@ export const certificatesMapping = createSelector(certificates, certs => { username, onionAddress, peerId, - dmPublicKey, }) }) return mapping @@ -58,7 +56,6 @@ export const csrsMapping = createSelector(csrs, csrs => { const username = getReqFieldValue(csr, CertFieldsTypes.nickName) const onionAddress = getReqFieldValue(csr, CertFieldsTypes.commonName) const peerId = getReqFieldValue(csr, CertFieldsTypes.peerId) - const dmPublicKey = getReqFieldValue(csr, CertFieldsTypes.dmPublicKey) || '' if (!username || !onionAddress || !peerId) { console.error(`Could not parse certificate for pubkey ${pubKey}`) @@ -69,7 +66,6 @@ export const csrsMapping = createSelector(csrs, csrs => { username, onionAddress, peerId, - dmPublicKey, }) }) @@ -130,14 +126,12 @@ export const ownerData = createSelector(ownerCertificate, ownerCertificate => { const username = getCertFieldValue(ownerCert, CertFieldsTypes.nickName) const onionAddress = getCertFieldValue(ownerCert, CertFieldsTypes.commonName) const peerId = getCertFieldValue(ownerCert, CertFieldsTypes.peerId) - const dmPublicKey = getCertFieldValue(ownerCert, CertFieldsTypes.dmPublicKey) const pubKey = keyFromCertificate(ownerCert) return { username, onionAddress, peerId, - dmPublicKey, pubKey, } }) diff --git a/packages/state-manager/src/sagas/users/users.types.ts b/packages/state-manager/src/sagas/users/users.types.ts index 689b52cb39..b934c98478 100644 --- a/packages/state-manager/src/sagas/users/users.types.ts +++ b/packages/state-manager/src/sagas/users/users.types.ts @@ -2,7 +2,6 @@ export interface User { username: string onionAddress: string peerId: string - dmPublicKey: string } export interface SendCertificatesResponse { diff --git a/packages/state-manager/src/utils/tests/factories.ts b/packages/state-manager/src/utils/tests/factories.ts index e73b7f84a1..9a0ee68f6a 100644 --- a/packages/state-manager/src/utils/tests/factories.ts +++ b/packages/state-manager/src/utils/tests/factories.ts @@ -93,10 +93,6 @@ export const getFactory = async (store: Store) => { 'ED25519-V3:WND1FoFZyY+c1f0uD6FBWgKvSYl4CdKSizSR7djRekW/rqw5fTw+gN80sGk0gl01sL5i25noliw85zF1BUBRDQ==', }, peerId: createPeerIdTestHelper(), - dmKeys: { - publicKey: '9f016defcbe48829db163e86b28efb10318faf3b109173105e3dc024e951bb1b', - privateKey: '4dcebbf395c0e9415bc47e52c96fcfaf4bd2485a516f45118c2477036b45fc0b', - }, nickname: factory.sequence('Identity.nickname', (n: number) => `user_${n}`), userCsr: undefined, userCertificate: undefined, @@ -115,7 +111,6 @@ export const getFactory = async (store: Store) => { nickname: action.payload.nickname, commonName: action.payload.hiddenService.onionAddress, peerId: action.payload.peerId.id, - dmPublicKey: action.payload.dmKeys.publicKey, }, community.CA ) diff --git a/packages/types/src/identity.ts b/packages/types/src/identity.ts index d00e906774..c2606e2c5d 100644 --- a/packages/types/src/identity.ts +++ b/packages/types/src/identity.ts @@ -10,11 +10,6 @@ export interface UserCsr { pkcs10: CertData } -export interface CreateDmKeyPairPayload { - dmPublicKey: string - dmPrivateKey: string -} - export interface HiddenService { onionAddress: string privateKey: string @@ -26,16 +21,10 @@ export interface PeerId { privKey?: string } -export interface DmKeys { - publicKey: string - privateKey: string -} - export interface Identity { id: string nickname: string hiddenService: HiddenService - dmKeys: DmKeys peerId: PeerId userCsr: UserCsr | null userCertificate: string | null @@ -49,7 +38,6 @@ export interface CreateUserCsrPayload { nickname: string commonName: string peerId: string - dmPublicKey: string signAlg: string hashAlg: string existingKeyPair?: CryptoKeyPair diff --git a/packages/types/src/user.ts b/packages/types/src/user.ts index 49aa963171..f7a3135624 100644 --- a/packages/types/src/user.ts +++ b/packages/types/src/user.ts @@ -2,7 +2,6 @@ export interface UserData { username: string onionAddress: string peerId: string - dmPublicKey: string } export interface User extends UserData {