1
0
Fork 0
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:
Ikko Ashimine 2022-09-24 15:16:52 +09:00 committed by GitHub
parent f6a9b49dfb
commit 9a9dd12253
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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()