diff --git a/src/activity_pub/activity.rs b/src/activity_pub/activity.rs index a068ad0..7edfa37 100644 --- a/src/activity_pub/activity.rs +++ b/src/activity_pub/activity.rs @@ -1,7 +1,6 @@ use chrono; use diesel::PgConnection; use serde_json; -use std::str::FromStr; use activity_pub::actor::Actor; use activity_pub::object::Object; diff --git a/src/activity_pub/request.rs b/src/activity_pub/request.rs index dc00f75..0db67b7 100644 --- a/src/activity_pub/request.rs +++ b/src/activity_pub/request.rs @@ -1,8 +1,6 @@ use base64; use diesel::PgConnection; -use hex; use openssl::hash::{Hasher, MessageDigest}; -use openssl::sha::sha256; use reqwest::header::{Date, Headers, UserAgent}; use std::time::SystemTime; @@ -45,7 +43,7 @@ pub fn signature(signer: &S, headers: Headers, conn: &PgConnection) - pub fn digest(body: String) -> Digest { let mut hasher = Hasher::new(MessageDigest::sha256()).unwrap(); - hasher.update(&body.into_bytes()[..]); + hasher.update(&body.into_bytes()[..]).unwrap(); let res = base64::encode(&hasher.finish().unwrap()); Digest(format!("SHA-256={}", res)) }