1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-08-06 12:02:40 +03:00

Remove node-specific crypto bits, use Node 16's WebCrypto (#2762)

This commit is contained in:
Michael Telatynski
2022-10-17 17:54:54 +01:00
committed by GitHub
parent 6af3b114e1
commit 30570bcce6
17 changed files with 177 additions and 265 deletions

View File

@@ -16,7 +16,6 @@ limitations under the License.
*/
import { logger } from '../src/logger';
import * as utils from "../src/utils";
// try to load the olm library.
try {
@@ -26,12 +25,3 @@ try {
} catch (e) {
logger.warn("unable to run crypto tests: libolm not available");
}
// also try to set node crypto
try {
// eslint-disable-next-line @typescript-eslint/no-var-requires
const crypto = require('crypto');
utils.setCrypto(crypto);
} catch (err) {
logger.log('nodejs was compiled without crypto support: some tests will fail');
}