Language: JavaScript
Label: safe
CWE: CWE-331 \u2014 Insufficient Entropy
The product uses an algorithm or scheme that produces insufficient entropy, leaving patterns or clusters of values that are more likely to occur than others.

Code:
    CryptoModule.prototype.decryptLegacyFileStream = function (stream, file, File) {
        return __awaiter(this, void 0, void 0, function () {
            var cryptor;
            return __generator(this, function (_a) {
                if (file.contentLength <= 16)
                    throw new Error('decryption error: empty content');
                cryptor = this.getLegacyCryptor();
                if (cryptor) {
                    return [2 /*return*/, cryptor.decryptFile(File.create({
                            name: file.name,
                            stream: stream,
                        }), File)];
                }
                else {
                    throw new Error('unknown cryptor error');
                }
                return [2 /*return*/];
            });
        });
    };