feat: added verification for the ssh keys #42

Merged
silver merged 5 commits from #15-set-email-via-ssh-key into main 2023-08-19 20:44:58 +00:00
Showing only changes of commit ab4b8d37df - Show all commits

View file

@ -440,12 +440,6 @@ pub mod ssh {
email: String,
}
#[derive(Debug, Deserialize)]
struct RequestResult {
auth: String,
keys: Vec<String>,
}
pub async fn request(mut req: Request<State>) -> tide::Result {
let RequestChallenge {
user,
@ -570,13 +564,10 @@ pub mod ssh {
if let Ok(x) = AuthorizedKeys::read_file(path) {
for entry in x {
let key = entry.public_key();
match key.verify("file", msg, &sig) {
Ok(_) => {
if key.verify("file", msg, &sig).is_ok() {
valid = true;
break;
}
Err(_) => {}
}
}
}
}