@wireapp/core 43.7.0 → 43.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/lib/Account.d.ts +12 -3
  2. package/lib/Account.d.ts.map +1 -1
  3. package/lib/Account.js +3 -3
  4. package/lib/messagingProtocols/mls/E2EIdentityService/Connection/AcmeServer/AcmeService.d.ts +72 -104
  5. package/lib/messagingProtocols/mls/E2EIdentityService/Connection/AcmeServer/AcmeService.d.ts.map +1 -1
  6. package/lib/messagingProtocols/mls/E2EIdentityService/Connection/AcmeServer/AcmeService.js +14 -33
  7. package/lib/messagingProtocols/mls/E2EIdentityService/Connection/AcmeServer/AcmeService.types.d.ts +2 -3
  8. package/lib/messagingProtocols/mls/E2EIdentityService/Connection/AcmeServer/AcmeService.types.d.ts.map +1 -1
  9. package/lib/messagingProtocols/mls/E2EIdentityService/E2EIService.types.d.ts +2 -5
  10. package/lib/messagingProtocols/mls/E2EIdentityService/E2EIService.types.d.ts.map +1 -1
  11. package/lib/messagingProtocols/mls/E2EIdentityService/E2EIServiceInternal.d.ts +8 -7
  12. package/lib/messagingProtocols/mls/E2EIdentityService/E2EIServiceInternal.d.ts.map +1 -1
  13. package/lib/messagingProtocols/mls/E2EIdentityService/E2EIServiceInternal.js +57 -119
  14. package/lib/messagingProtocols/mls/E2EIdentityService/Steps/Authorization.d.ts +2 -2
  15. package/lib/messagingProtocols/mls/E2EIdentityService/Steps/Authorization.d.ts.map +1 -1
  16. package/lib/messagingProtocols/mls/E2EIdentityService/Steps/Authorization.js +3 -3
  17. package/lib/messagingProtocols/mls/E2EIdentityService/Steps/DpopChallenge/DpopChallenge.d.ts +6 -10
  18. package/lib/messagingProtocols/mls/E2EIdentityService/Steps/DpopChallenge/DpopChallenge.d.ts.map +1 -1
  19. package/lib/messagingProtocols/mls/E2EIdentityService/Steps/DpopChallenge/DpopChallenge.types.d.ts +2 -2
  20. package/lib/messagingProtocols/mls/E2EIdentityService/Steps/DpopChallenge/DpopChallenge.types.d.ts.map +1 -1
  21. package/lib/messagingProtocols/mls/E2EIdentityService/Steps/OidcChallenge.d.ts +13 -17
  22. package/lib/messagingProtocols/mls/E2EIdentityService/Steps/OidcChallenge.d.ts.map +1 -1
  23. package/lib/messagingProtocols/mls/E2EIdentityService/Steps/Order.d.ts +4 -4
  24. package/lib/messagingProtocols/mls/E2EIdentityService/Steps/Order.d.ts.map +1 -1
  25. package/lib/messagingProtocols/mls/E2EIdentityService/Steps/Order.js +9 -10
  26. package/lib/messagingProtocols/mls/E2EIdentityService/Storage/E2EIStorage.js +2 -2
  27. package/lib/messagingProtocols/mls/E2EIdentityService/Storage/E2EIStorage.schema.d.ts +5 -0
  28. package/lib/messagingProtocols/mls/E2EIdentityService/Storage/E2EIStorage.schema.d.ts.map +1 -1
  29. package/lib/messagingProtocols/mls/E2EIdentityService/Storage/E2EIStorage.schema.js +1 -0
  30. package/lib/messagingProtocols/mls/MLSService/MLSService.d.ts +11 -2
  31. package/lib/messagingProtocols/mls/MLSService/MLSService.d.ts.map +1 -1
  32. package/lib/messagingProtocols/mls/MLSService/MLSService.js +36 -40
  33. package/package.json +4 -4
@@ -635,49 +635,45 @@ class MLSService extends commons_1.TypedEventEmitter {
635
635
  // If we don't have an OAuth id token, we need to start the certificate process with Oauth
636
636
  if (!oAuthIdToken) {
637
637
  const data = await instance.startCertificateProcess(hasActiveCertificate);
638
- if (data) {
639
- return data;
638
+ const oidcChallenge = data.challenge;
639
+ if (!oidcChallenge) {
640
+ throw new Error('Not oidc challenge found');
640
641
  }
641
- // If we have an OAuth id token, we can continue the certificate process / start a refresh
642
+ return { status: 'authentication', authenticationChallenge: data };
642
643
  }
643
- else {
644
- let rotateBundle;
645
- // If we are not refreshing the active certificate, we need to continue the certificate process with Oauth
646
- if (!hasActiveCertificate) {
647
- rotateBundle = await instance.continueCertificateProcess(oAuthIdToken);
648
- // If we are refreshing the active certificate, can start the refresh process
649
- }
650
- else {
651
- rotateBundle = await instance.startRefreshCertficateFlow(oAuthIdToken, hasActiveCertificate);
652
- }
653
- if (rotateBundle !== undefined) {
654
- // upload the clients public keys
655
- if (!hasActiveCertificate) {
656
- // we only upload public keys for the initial certification process. Renewals do not need to upload new public keys
657
- await this.uploadMLSPublicKeys(client);
658
- }
659
- // Remove old key packages
660
- await this.deleteMLSKeyPackages(client.id, rotateBundle.keyPackageRefsToRemove);
661
- // Upload new key packages with x509 certificate
662
- await this.uploadMLSKeyPackages(client.id, rotateBundle.newKeyPackages);
663
- // Verify that we have enough key packages
664
- await this.verifyRemoteMLSKeyPackagesAmount(client.id);
665
- // Update keying material
666
- for (const [groupId, commitBundle] of rotateBundle.commits) {
667
- const groupIdAsBytes = bazinga64_1.Converter.hexStringToArrayBufferView(groupId);
668
- // manual copy of the commit bundle data because of a problem while cloning it
669
- const newCommitBundle = {
670
- commit: commitBundle.commit,
671
- // @ts-ignore
672
- groupInfo: (commitBundle === null || commitBundle === void 0 ? void 0 : commitBundle.group_info) || commitBundle.groupInfo,
673
- welcome: commitBundle === null || commitBundle === void 0 ? void 0 : commitBundle.welcome,
674
- };
675
- await this.uploadCommitBundle(groupIdAsBytes, newCommitBundle);
676
- }
677
- return true;
678
- }
644
+ // If we have an OAuth id token, we can continue the certificate process / start a refresh
645
+ const rotateBundle = !hasActiveCertificate
646
+ ? // If we are not refreshing the active certificate, we need to continue the certificate process with Oauth
647
+ await instance.continueCertificateProcess(oAuthIdToken)
648
+ : // If we are refreshing the active certificate, can start the refresh process
649
+ await instance.startRefreshCertficateFlow(oAuthIdToken, hasActiveCertificate);
650
+ if (rotateBundle === undefined) {
651
+ throw new Error('Could not get the rotate bundle');
652
+ }
653
+ // upload the clients public keys
654
+ if (!hasActiveCertificate) {
655
+ // we only upload public keys for the initial certification process. Renewals do not need to upload new public keys
656
+ await this.uploadMLSPublicKeys(client);
657
+ }
658
+ // Remove old key packages
659
+ await this.deleteMLSKeyPackages(client.id, rotateBundle.keyPackageRefsToRemove);
660
+ // Upload new key packages with x509 certificate
661
+ await this.uploadMLSKeyPackages(client.id, rotateBundle.newKeyPackages);
662
+ // Verify that we have enough key packages
663
+ await this.verifyRemoteMLSKeyPackagesAmount(client.id);
664
+ // Update keying material
665
+ for (const [groupId, commitBundle] of rotateBundle.commits) {
666
+ const groupIdAsBytes = bazinga64_1.Converter.hexStringToArrayBufferView(groupId);
667
+ // manual copy of the commit bundle data because of a problem while cloning it
668
+ const newCommitBundle = {
669
+ commit: commitBundle.commit,
670
+ // @ts-ignore
671
+ groupInfo: (commitBundle === null || commitBundle === void 0 ? void 0 : commitBundle.group_info) || commitBundle.groupInfo,
672
+ welcome: commitBundle === null || commitBundle === void 0 ? void 0 : commitBundle.welcome,
673
+ };
674
+ await this.uploadCommitBundle(groupIdAsBytes, newCommitBundle);
679
675
  }
680
- return false;
676
+ return { status: 'successful' };
681
677
  }
682
678
  catch (error) {
683
679
  this.logger.error('E2EI - Failed to enroll', error);
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "./lib/cryptography/AssetCryptography/crypto.node": "./lib/cryptography/AssetCryptography/crypto.browser.js"
12
12
  },
13
13
  "dependencies": {
14
- "@wireapp/api-client": "^26.10.0",
14
+ "@wireapp/api-client": "^26.10.1",
15
15
  "@wireapp/commons": "^5.2.4",
16
16
  "@wireapp/core-crypto": "1.0.0-rc.30",
17
17
  "@wireapp/cryptobox": "12.8.0",
@@ -44,7 +44,7 @@
44
44
  "fake-indexeddb": "^4.0.0",
45
45
  "jest": "^29.2.1",
46
46
  "jest-websocket-mock": "2.5.0",
47
- "nock": "13.4.0",
47
+ "nock": "13.5.0",
48
48
  "rimraf": "^3.0.2",
49
49
  "typescript": "^5.0.4"
50
50
  },
@@ -61,6 +61,6 @@
61
61
  "test:coverage": "jest --coverage",
62
62
  "watch": "tsc --watch"
63
63
  },
64
- "version": "43.7.0",
65
- "gitHead": "71eefe703ca0058852ceb6fb62510fccff2c33ab"
64
+ "version": "43.7.2",
65
+ "gitHead": "368d0946bb85bb8eff2c71d91b8c4b46c14aeb1d"
66
66
  }