mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-08-01 02:06:17 -04:00
Crypto(X25519): don't check for deriveBits permission twice
This commit is contained in:
@@ -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,
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user