Skip to content

Commit 856a689

Browse files
restyled-commitsnevi-me
authored andcommitted
Restyled by rustfmt
1 parent 0fa2170 commit 856a689

File tree

1 file changed

+19
-15
lines changed

1 file changed

+19
-15
lines changed

matter/src/crypto/crypto_rustcrypto.rs

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,17 @@ use ccm::{
2626
use elliptic_curve::sec1::{FromEncodedPoint, ToEncodedPoint};
2727
use hmac::Mac;
2828
use log::error;
29-
use p256::{ecdsa::{SigningKey, VerifyingKey, Signature}, SecretKey, PublicKey, EncodedPoint, AffinePoint};
29+
use p256::{
30+
ecdsa::{Signature, SigningKey, VerifyingKey},
31+
AffinePoint, EncodedPoint, PublicKey, SecretKey,
32+
};
3033
use sha2::Digest;
3134
use x509_cert::{
3235
attr::AttributeType,
3336
der::{asn1::BitString, Any, Encode},
34-
spki::{AlgorithmIdentifier, SubjectPublicKeyInfoOwned}, name::RdnSequence, request::CertReq,
37+
name::RdnSequence,
38+
request::CertReq,
39+
spki::{AlgorithmIdentifier, SubjectPublicKeyInfoOwned},
3540
};
3641

3742
use crate::error::Error;
@@ -159,20 +164,19 @@ impl CryptoKeyPair for KeyPair {
159164
fn get_csr<'a>(&self, out_csr: &'a mut [u8]) -> Result<&'a [u8], Error> {
160165
use p256::ecdsa::signature::Signer;
161166

162-
let subject =
163-
RdnSequence(vec![x509_cert::name::RelativeDistinguishedName(
164-
vec![x509_cert::attr::AttributeTypeAndValue {
165-
// Organization name: http://www.oid-info.com/get/2.5.4.10
166-
oid: x509_cert::attr::AttributeType::new_unwrap("2.5.4.10"),
167-
value: x509_cert::attr::AttributeValue::new(
168-
x509_cert::der::Tag::Utf8String,
169-
"CSR".as_bytes(),
170-
)
171-
.unwrap(),
172-
}]
173-
.try_into()
167+
let subject = RdnSequence(vec![x509_cert::name::RelativeDistinguishedName(
168+
vec![x509_cert::attr::AttributeTypeAndValue {
169+
// Organization name: http://www.oid-info.com/get/2.5.4.10
170+
oid: x509_cert::attr::AttributeType::new_unwrap("2.5.4.10"),
171+
value: x509_cert::attr::AttributeValue::new(
172+
x509_cert::der::Tag::Utf8String,
173+
"CSR".as_bytes(),
174+
)
174175
.unwrap(),
175-
)]);
176+
}]
177+
.try_into()
178+
.unwrap(),
179+
)]);
176180
let mut pubkey = [0; 65];
177181
self.get_public_key(&mut pubkey).unwrap();
178182
let info = x509_cert::request::CertReqInfo {

0 commit comments

Comments
 (0)