mirror of
https://github.com/Drop-OSS/droplet.git
synced 2025-11-10 04:22:16 +10:00
@ -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"
|
||||
|
||||
|
||||
@ -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() {
|
||||
|
||||
@ -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
|
||||
};
|
||||
|
||||
|
||||
@ -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();
|
||||
|
||||
Reference in New Issue
Block a user