pam-ssh-agent 0.9.5

A PAM module that authenticates using the ssh-agent.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use ssh_agent_client_rs::{Client, Identity, Result};
use ssh_key::Signature;

/// A small trait defining the two methods of ssh_agent_client_rs::Client to simplify testing
pub trait SSHAgent {
    fn list_identities(&mut self) -> Result<Vec<Identity<'static>>>;
    fn sign<'a>(&mut self, key: impl Into<Identity<'a>>, data: &[u8]) -> Result<Signature>;
}

impl SSHAgent for Client {
    fn list_identities(&mut self) -> Result<Vec<Identity<'static>>> {
        self.list_all_identities()
    }
    fn sign<'a>(&mut self, key: impl Into<Identity<'a>>, data: &[u8]) -> Result<Signature> {
        self.sign(key, data)
    }
}