hardcode path
This commit is contained in:
@@ -2,13 +2,17 @@ pub use shared_memory_heap::sharedptr::SharedPtr;
|
|||||||
|
|
||||||
use crate::agent::Agent;
|
use crate::agent::Agent;
|
||||||
use std::{
|
use std::{
|
||||||
ops::Deref, path::Path, sync::{LazyLock, Mutex}
|
ops::Deref,
|
||||||
|
path::Path,
|
||||||
|
sync::{LazyLock, Mutex},
|
||||||
};
|
};
|
||||||
|
|
||||||
static X25519AGENT: LazyLock<Mutex<Agent>> = LazyLock::new(|| {
|
static X25519AGENT: LazyLock<Mutex<Agent>> = LazyLock::new(|| {
|
||||||
let agent_path = std::env::var("X25519_AGENT_PATH").expect("X25519_AGENT_PATH environment variable missing");
|
let agent_path = "agent_harness";
|
||||||
let keyfile_path = std::env::var("X25519_KEYFILE").expect("X25519_KEYFILE environment variable missing");
|
let keyfile_path = "/etc/x25519-agent/keyfile";
|
||||||
let agent = unsafe { Agent::new(Path::new(&agent_path), Path::new(&keyfile_path)).expect("Agent failed to start") };
|
let agent = unsafe {
|
||||||
|
Agent::new(Path::new(&agent_path), Path::new(&keyfile_path)).expect("Agent failed to start")
|
||||||
|
};
|
||||||
Mutex::new(agent)
|
Mutex::new(agent)
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -94,7 +98,10 @@ pub fn x25519(sk: &X25519PrivKey, pk: &X25519PubKey) -> X25519SharedKey {
|
|||||||
let mut agent = X25519AGENT.lock().unwrap();
|
let mut agent = X25519AGENT.lock().unwrap();
|
||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
agent.perform_ipc_call(2, &[out.0.get_offset(), sk.0.get_offset(), pk.0.get_offset()]);
|
agent.perform_ipc_call(
|
||||||
|
2,
|
||||||
|
&[out.0.get_offset(), sk.0.get_offset(), pk.0.get_offset()],
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
drop(agent);
|
drop(agent);
|
||||||
|
|||||||
Reference in New Issue
Block a user