Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ node_modules/
tsconfig.tsbuildinfo
package-lock.json
.vscode/settings.json
.vscode/mcp.json
Binary file modified bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion packages/example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,6 @@ SPEC CHECKSUMS:
SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17
Yoga: 4c3aa327e4a6a23eeacd71f61c81df1bcdf677d5

PODFILE CHECKSUM: 30bd43484b3dbde5a95cbc2b8bc0e28edb1e7bb6
PODFILE CHECKSUM: 47469ccd5c1c311cbf9db829bd8c082c7fc29cca

COCOAPODS: 1.15.2
30 changes: 22 additions & 8 deletions packages/example/src/testing/tests/webcryptoTests/import_export.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -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;

Expand Down Expand Up @@ -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 () => {
Expand Down
1 change: 0 additions & 1 deletion packages/react-native-quick-crypto/cpp/MGLKeys.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,6 @@ KeyObjectData::KeyObjectData(KeyType type,

std::shared_ptr<KeyObjectData> KeyObjectData::CreateSecret(ByteSource key)
{
CHECK(key);
return std::shared_ptr<KeyObjectData>(new KeyObjectData(std::move(key)));
}

Expand Down