Crypto(X25519): don't check for deriveBits permission twice

This commit is contained in:
Halil Durak
2026-06-17 14:31:46 +03:00
parent 6f47466b34
commit b9c718642b
2 changed files with 0 additions and 5 deletions

View File

@@ -414,7 +414,6 @@ fn deriveRaw(
if (eqlIgnoreCase(params.name, "X25519")) {
// null length means "derive the full shared secret" (256 bits).
const result = X25519.deriveBits(base_key, params.public, length orelse 256, exec) catch |err| switch (err) {
error.InvalidAccessError => return error.InvalidAccessError,
error.OutOfMemory => return error.OutOfMemory,
else => return error.OperationError,
};

View File

@@ -123,10 +123,6 @@ pub fn deriveBits(
length_in_bits: usize,
exec: *const Execution,
) !js.ArrayBuffer {
if (!private.canDeriveBits()) {
return error.InvalidAccessError;
}
const ctx = crypto.EVP_PKEY_CTX_new(private.getKeyObject(), null) orelse {
// Failed on our end.
return error.Internal;