summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2022-09-28 20:55:02 +0300
committerLars Wirzenius <liw@liw.fi>2022-09-28 20:55:02 +0300
commitfbd9f79cb85a2eb8781dada9941467986cf7db72 (patch)
tree97917b1730af939ae2b6527d8ebc399786f512c6
parent1f3950e07414f8689fc1e410d2fa4c0585fe1338 (diff)
downloadsshca-fbd9f79cb85a2eb8781dada9941467986cf7db72.tar.gz
fix: don't add an extra newline when writing out public keys
Sponsored-by: author
-rw-r--r--src/cmd/ca.rs4
-rw-r--r--src/cmd/host.rs2
-rw-r--r--src/cmd/user.rs2
3 files changed, 4 insertions, 4 deletions
diff --git a/src/cmd/ca.rs b/src/cmd/ca.rs
index 850b14c..979dcd9 100644
--- a/src/cmd/ca.rs
+++ b/src/cmd/ca.rs
@@ -150,9 +150,9 @@ pub struct PublicKey {
impl Runnable for PublicKey {
fn run(&mut self, _config: &Config, store: &mut KeyStore) -> Result<(), CAError> {
if let Some(ca) = store.get_host_ca(&self.name) {
- println!("{}", ca.keypair().public().as_str());
+ print!("{}", ca.keypair().public().as_str());
} else if let Some(ca) = store.get_user_ca(&self.name) {
- println!("{}", ca.keypair().public().as_str());
+ print!("{}", ca.keypair().public().as_str());
} else {
return Err(CAError::NoSuchHostCA(self.name.clone()));
}
diff --git a/src/cmd/host.rs b/src/cmd/host.rs
index 6a84537..d93bb3d 100644
--- a/src/cmd/host.rs
+++ b/src/cmd/host.rs
@@ -228,7 +228,7 @@ pub struct PublicKeyCmd {
impl Runnable for PublicKeyCmd {
fn run(&mut self, _config: &Config, store: &mut KeyStore) -> Result<(), CAError> {
if let Some(host) = store.get_host(&self.hostname) {
- println!("{}", host.public().as_str());
+ print!("{}", host.public().as_str());
} else {
return Err(CAError::NoSuchHost(self.hostname.clone()));
}
diff --git a/src/cmd/user.rs b/src/cmd/user.rs
index bdba965..ea4feb1 100644
--- a/src/cmd/user.rs
+++ b/src/cmd/user.rs
@@ -219,7 +219,7 @@ pub struct PublicKeyCmd {
impl Runnable for PublicKeyCmd {
fn run(&mut self, _config: &Config, store: &mut KeyStore) -> Result<(), CAError> {
if let Some(pair) = store.get_user(&self.username) {
- println!("{}", pair.public().as_str());
+ print!("{}", pair.public().as_str());
} else {
return Err(CAError::NoSuchUser(self.username.clone()));
}