Add packet session key identifiers
This commit is contained in:
+2
-6
@@ -1,5 +1,6 @@
|
||||
use crate::config::{ServerConfig, expand_tilde};
|
||||
use crate::crypto;
|
||||
use crate::protocol;
|
||||
use anyhow::{Context, Result};
|
||||
use base64::Engine;
|
||||
use base64::engine::general_purpose::URL_SAFE_NO_PAD;
|
||||
@@ -105,12 +106,7 @@ pub fn build_bootstrap(
|
||||
&client_nonce,
|
||||
format!("dosh/session/{user}/{session}/{issued_at}").as_bytes(),
|
||||
)?;
|
||||
let session_key_id = {
|
||||
let digest = crypto::sha256(&session_key);
|
||||
let mut out = [0u8; 16];
|
||||
out.copy_from_slice(&digest[..16]);
|
||||
out
|
||||
};
|
||||
let session_key_id = protocol::session_key_id(&session_key);
|
||||
let attach_token = attach_token(
|
||||
secret,
|
||||
&user,
|
||||
|
||||
Reference in New Issue
Block a user