1
0
Fork 0

Merging upstream version 0.5.8.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-05-25 09:57:50 +02:00
parent 0b173dae8e
commit b2b58aaf60
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
9 changed files with 19 additions and 18 deletions

View file

@ -1,6 +1,6 @@
{
"git": {
"sha1": "527e6ada07ae24ab2f4811d8b0d6e9146c94bfe0"
"sha1": "3ba94e6efe2c59a4ffd2e6beb4bc96e958998979"
},
"path_in_vcs": ""
}

View file

@ -1,3 +1,7 @@
# Version 0.5.8 - 2025-05-23
- [fix][minor] Fix loading of default ECDSA key.
- [add][patch] Log a warning when processing a private key in unknown format.
# Version 0.5.7 - 2025-02-13
- [change][patch] Update internal dependencies.

2
Cargo.lock generated
View file

@ -87,7 +87,7 @@ dependencies = [
[[package]]
name = "auth-git2"
version = "0.5.7"
version = "0.5.8"
dependencies = [
"assert2",
"clap",

View file

@ -12,7 +12,7 @@
[package]
edition = "2021"
name = "auth-git2"
version = "0.5.7"
version = "0.5.8"
authors = ["Maarten de Vries <maarten@de-vri.es>"]
build = false
publish = ["crates-io"]
@ -35,6 +35,9 @@ categories = ["authentication"]
license = "BSD-2-Clause"
repository = "https://github.com/de-vri-es/auth-git2-rs"
[features]
log = ["dep:log"]
[lib]
name = "auth_git2"
path = "src/lib.rs"
@ -73,6 +76,3 @@ version = "0.11.6"
[dev-dependencies.git2]
version = ">=0.14, <21.0"
[features]
log = ["dep:log"]

2
Cargo.toml.orig generated
View file

@ -1,6 +1,6 @@
[package]
name = "auth-git2"
version = "0.5.7"
version = "0.5.8"
description = "Authentication for `git2`"
license = "BSD-2-Clause"
authors = ["Maarten de Vries <maarten@de-vri.es>"]

View file

@ -47,7 +47,7 @@ pub enum Error {
AskpassExitStatus(AskpassExitStatusError),
/// Password contains invalid UTF-8.
InvalidUtf8(std::string::FromUtf8Error),
InvalidUtf8,
/// Failed to open a handle to the main terminal of the process.
OpenTerminal(std::io::Error),
@ -153,7 +153,7 @@ fn askpass_prompt(program: &Path, prompt: &str) -> Result<String, Error> {
.map_err(Error::AskpassCommand)?;
if output.status.success() {
let password = String::from_utf8(output.stdout)
.map_err(Error::InvalidUtf8)?;
.map_err(|_| Error::InvalidUtf8)?;
Ok(password)
} else {
// Do not keep stdout, it could contain a password D:
@ -169,7 +169,7 @@ impl std::fmt::Display for Error {
match self {
Self::AskpassCommand(e) => write!(f, "Failed to run askpass command: {e}"),
Self::AskpassExitStatus(e) => write!(f, "{e}"),
Self::InvalidUtf8(_) => write!(f, "User response contains invalid UTF-8"),
Self::InvalidUtf8 => write!(f, "User response contains invalid UTF-8"),
Self::OpenTerminal(e) => write!(f, "Failed to open terminal: {e}"),
Self::ReadWriteTerminal(e) => write!(f, "Failed to read/write to terminal: {e}"),
}

View file

@ -349,7 +349,7 @@ impl GitAuthenticator {
let candidates = [
"id_rsa",
"id_ecdsa,",
"id_ecdsa",
"id_ecdsa_sk",
"id_ed25519",
"id_ed25519_sk",
@ -615,6 +615,9 @@ impl PrivateKeyFile {
None
},
Ok(key_info) => {
if key_info.format == ssh_key::KeyFormat::Unknown {
warn!("Unknown key format for key: {}", self.private_key.display());
}
if key_info.encrypted {
prompter.prompt_ssh_key_passphrase(&self.private_key, git_config)
} else {

View file

@ -33,9 +33,6 @@ pub(crate) trait ClonePrompter: Prompter {
/// Clone the `Box<dyn ClonePrompter>`.
fn dyn_clone(&self) -> Box<dyn ClonePrompter>;
/// Get `self` as plain `Prompter`.
fn as_prompter(&self) -> &dyn Prompter;
/// Get `self` as plain `Prompter`.
fn as_prompter_mut(&mut self) -> &mut dyn Prompter;
}
@ -49,10 +46,6 @@ where
Box::new(self.clone())
}
fn as_prompter(&self) -> &dyn Prompter {
self
}
fn as_prompter_mut(&mut self) -> &mut dyn Prompter {
self
}

View file

@ -22,6 +22,7 @@ pub enum Error {
}
/// The format of a key file.
#[derive(Copy, Clone, Eq, PartialEq)]
pub enum KeyFormat {
/// We don't know what format it is.
Unknown,