Ran cargo fmt

Signed-off-by: quexeky <git@quexeky.dev>
This commit is contained in:
quexeky
2024-11-04 18:15:06 +11:00
parent 119f42e2ba
commit 6a951bd33d
4 changed files with 17 additions and 11 deletions

View File

@ -12,7 +12,6 @@ napi = { version = "2.12.2", default-features = false, features = ["napi4", "asy
napi-derive = "2.12.2"
time = "0.3.36"
hex = "0.4.3"
gxhash = "=2.3.0"
serde_json = "1.0.128"
md5 = "0.7.0"

View File

@ -1,4 +1,7 @@
use std::{fs::{self, metadata}, path::{Path, PathBuf}};
use std::{
fs::{self, metadata},
path::{Path, PathBuf},
};
fn _list_files(vec: &mut Vec<PathBuf>, path: &Path) {
if metadata(path).unwrap().is_dir() {

View File

@ -1,5 +1,9 @@
use std::{
collections::HashMap, fs::File, io::{BufRead, BufReader}, path::Path, thread
collections::HashMap,
fs::File,
io::{BufRead, BufReader},
path::Path,
thread,
};
#[cfg(unix)]
@ -73,11 +77,15 @@ pub fn generate_manifest(
let relative = file_path.strip_prefix(base_dir).unwrap();
let permission_object = file.try_clone().unwrap().metadata().unwrap().permissions();
let permissions = {
let mut perm = 0;
#[cfg(unix)]
let perm: u32;
#[cfg(target_family = "unix")]
{
perm = permission_object.mode();
}
#[cfg(not(target_family = "unix"))]
{
perm = 0
}
perm
};

View File

@ -1,4 +1,5 @@
use napi::Error;
use openssl::asn1::Asn1Integer;
use openssl::{
asn1::Asn1Time,
bn::{BigNum, MsbOption},
@ -14,7 +15,6 @@ use openssl::{
X509Builder, X509NameBuilder, X509ReqBuilder, X509StoreContext, X509,
},
};
use openssl::asn1::Asn1Integer;
fn create_serial_number() -> Asn1Integer {
let mut serial = BigNum::new().unwrap();
@ -218,11 +218,7 @@ pub fn verify_nonce(public_cert: String, nonce: String, signature: String) -> Re
let signature = hex::decode(signature).unwrap();
let mut verifier = Verifier::new(
MessageDigest::sha256(),
&client_public_key,
)
.unwrap();
let mut verifier = Verifier::new(MessageDigest::sha256(), &client_public_key).unwrap();
verifier.update(nonce.as_bytes()).unwrap();
let result = verifier.verify(&signature).unwrap();