mirror of
https://github.com/denoland/deno.git
synced 2025-01-10 08:09:06 -05:00
chore(ext/crypto): fix typo in import_key.rs (#16012)
eliptic -> elliptic
This commit is contained in:
parent
f6a9b49dfb
commit
9a9dd12253
1 changed files with 8 additions and 8 deletions
|
@ -754,19 +754,19 @@ fn import_key_ec(
|
|||
EcNamedCurve::P256 => {
|
||||
// 1-2.
|
||||
let point = p256::EncodedPoint::from_bytes(&data)
|
||||
.map_err(|_| data_error("invalid P-256 eliptic curve point"))?;
|
||||
.map_err(|_| data_error("invalid P-256 elliptic curve point"))?;
|
||||
// 3.
|
||||
if point.is_identity() {
|
||||
return Err(data_error("invalid P-256 eliptic curve point"));
|
||||
return Err(data_error("invalid P-256 elliptic curve point"));
|
||||
}
|
||||
}
|
||||
EcNamedCurve::P384 => {
|
||||
// 1-2.
|
||||
let point = p384::EncodedPoint::from_bytes(&data)
|
||||
.map_err(|_| data_error("invalid P-384 eliptic curve point"))?;
|
||||
.map_err(|_| data_error("invalid P-384 elliptic curve point"))?;
|
||||
// 3.
|
||||
if point.is_identity() {
|
||||
return Err(data_error("invalid P-384 eliptic curve point"));
|
||||
return Err(data_error("invalid P-384 elliptic curve point"));
|
||||
}
|
||||
}
|
||||
_ => return Err(not_supported_error("Unsupported named curve")),
|
||||
|
@ -874,10 +874,10 @@ fn import_key_ec(
|
|||
EcNamedCurve::P256 => {
|
||||
let point =
|
||||
p256::EncodedPoint::from_bytes(&*encoded_key).map_err(|_| {
|
||||
data_error("invalid P-256 eliptic curve SPKI data")
|
||||
data_error("invalid P-256 elliptic curve SPKI data")
|
||||
})?;
|
||||
if point.is_identity() {
|
||||
return Err(data_error("invalid P-256 eliptic curve point"));
|
||||
return Err(data_error("invalid P-256 elliptic curve point"));
|
||||
}
|
||||
|
||||
point.as_bytes().len()
|
||||
|
@ -885,11 +885,11 @@ fn import_key_ec(
|
|||
EcNamedCurve::P384 => {
|
||||
let point =
|
||||
p384::EncodedPoint::from_bytes(&*encoded_key).map_err(|_| {
|
||||
data_error("invalid P-384 eliptic curve SPKI data")
|
||||
data_error("invalid P-384 elliptic curve SPKI data")
|
||||
})?;
|
||||
|
||||
if point.is_identity() {
|
||||
return Err(data_error("invalid P-384 eliptic curve point"));
|
||||
return Err(data_error("invalid P-384 elliptic curve point"));
|
||||
}
|
||||
|
||||
point.as_bytes().len()
|
||||
|
|
Loading…
Reference in a new issue