aboutsummaryrefslogtreecommitdiff
path: root/src/pki_container_openssh.c
diff options
context:
space:
mode:
authorAnderson Toshiyuki Sasaki <ansasaki@redhat.com>2019-08-22 18:11:13 +0200
committerAnderson Toshiyuki Sasaki <ansasaki@redhat.com>2019-09-24 16:49:35 +0200
commit2a2c1c98bf4129f4c70ec1fef6558c2e5af15e5d (patch)
tree96005f242de1ace1d2a8bc62b80dc37318e39e2f /src/pki_container_openssh.c
parentbdcaf55b906bedb84df1cf0637137f674dd5ce64 (diff)
downloadlibssh-2a2c1c98bf4129f4c70ec1fef6558c2e5af15e5d.tar.gz
libssh-2a2c1c98bf4129f4c70ec1fef6558c2e5af15e5d.tar.xz
libssh-2a2c1c98bf4129f4c70ec1fef6558c2e5af15e5d.zip
pki_crypto: Use OpenSSL for Ed25519 signatures
Use OpenSSL to generate and verify Ed25519 signatures, if supported. Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> Reviewed-by: Jakub Jelen <jjelen@redhat.com>
Diffstat (limited to 'src/pki_container_openssh.c')
-rw-r--r--src/pki_container_openssh.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/pki_container_openssh.c b/src/pki_container_openssh.c
index 4b98bccf..705cd19a 100644
--- a/src/pki_container_openssh.c
+++ b/src/pki_container_openssh.c
@@ -415,12 +415,13 @@ static int pki_openssh_export_privkey_blob(const ssh_key privkey,
return SSH_ERROR;
}
rc = ssh_buffer_pack(buffer,
- "sdPdP",
+ "sdPdPP",
privkey->type_c,
- (uint32_t)ED25519_PK_LEN,
- (size_t)ED25519_PK_LEN, privkey->ed25519_pubkey,
- (uint32_t)ED25519_SK_LEN,
- (size_t)ED25519_SK_LEN, privkey->ed25519_privkey);
+ (uint32_t)ED25519_KEY_LEN,
+ (size_t)ED25519_KEY_LEN, privkey->ed25519_pubkey,
+ (uint32_t)(2 * ED25519_KEY_LEN),
+ (size_t)ED25519_KEY_LEN, privkey->ed25519_privkey,
+ (size_t)ED25519_KEY_LEN, privkey->ed25519_pubkey);
return rc;
}