diff --git a/.gitignore b/.gitignore index 53f0017f..691e5945 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ node_modules/ tsconfig.tsbuildinfo package-lock.json .vscode/settings.json +.vscode/mcp.json diff --git a/bun.lockb b/bun.lockb index 67cfab12..e4b2e438 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/packages/example/ios/Podfile.lock b/packages/example/ios/Podfile.lock index ae0c011c..bd457a2c 100644 --- a/packages/example/ios/Podfile.lock +++ b/packages/example/ios/Podfile.lock @@ -652,6 +652,6 @@ SPEC CHECKSUMS: SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17 Yoga: 4c3aa327e4a6a23eeacd71f61c81df1bcdf677d5 -PODFILE CHECKSUM: 30bd43484b3dbde5a95cbc2b8bc0e28edb1e7bb6 +PODFILE CHECKSUM: 47469ccd5c1c311cbf9db829bd8c082c7fc29cca COCOAPODS: 1.15.2 diff --git a/packages/example/src/testing/tests/webcryptoTests/import_export.ts b/packages/example/src/testing/tests/webcryptoTests/import_export.ts index 3e8f9d55..e0f1f64e 100644 --- a/packages/example/src/testing/tests/webcryptoTests/import_export.ts +++ b/packages/example/src/testing/tests/webcryptoTests/import_export.ts @@ -1,17 +1,11 @@ -import { assert, expect } from 'chai'; import { Buffer } from '@craftzdog/react-native-buffer'; +import { assert, expect } from 'chai'; import { fromByteArray, toByteArray, trimBase64Padding, } from 'react-native-quick-base64'; import crypto from 'react-native-quick-crypto'; -import { describe, it } from '../../MochaRNAdapter'; -import { - ab2str, - binaryLikeToArrayBuffer, -} from '../../../../../react-native-quick-crypto/src/Utils'; -import { assertThrowsAsync } from '../util'; import type { CryptoKey, CryptoKeyPair, @@ -23,8 +17,14 @@ import type { SubtleAlgorithm, } from '../../../../../react-native-quick-crypto/src/keys'; import type { RandomTypedArrays } from '../../../../../react-native-quick-crypto/src/random'; -import pubTestKeyEc256 from '../../fixtures/keys/ec_p256_public'; +import { + ab2str, + binaryLikeToArrayBuffer, +} from '../../../../../react-native-quick-crypto/src/Utils'; import privTestKeyEc256 from '../../fixtures/keys/ec_p256_private'; +import pubTestKeyEc256 from '../../fixtures/keys/ec_p256_public'; +import { describe, it } from '../../MochaRNAdapter'; +import { assertThrowsAsync } from '../util'; const { subtle, createPublicKey, createPrivateKey } = crypto; @@ -132,6 +132,20 @@ describe('subtle - importKey / exportKey', () => { ); }); + it(' importKey - raw - pbkdf2 - empty byte source #735', async () => { + const key = await crypto.subtle.importKey( + 'raw', + new Uint8Array(), + { + name: 'PBKDF2', + hash: 'SHA-256', + }, + false, + ['deriveBits', 'deriveKey'], + ); + expect(key).to.not.equal(null); + }); + // Import/Export AES Secret Key { it('AES import raw / export raw', async () => { diff --git a/packages/react-native-quick-crypto/cpp/MGLKeys.cpp b/packages/react-native-quick-crypto/cpp/MGLKeys.cpp index bd7e7de4..0cead675 100644 --- a/packages/react-native-quick-crypto/cpp/MGLKeys.cpp +++ b/packages/react-native-quick-crypto/cpp/MGLKeys.cpp @@ -806,7 +806,6 @@ KeyObjectData::KeyObjectData(KeyType type, std::shared_ptr KeyObjectData::CreateSecret(ByteSource key) { - CHECK(key); return std::shared_ptr(new KeyObjectData(std::move(key))); }