mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-08-08 19:02:06 +03:00
pki: Move keyfiles to pki_gcrypt.c.
This commit is contained in:
@@ -91,7 +91,6 @@ set(libssh_SRCS
|
|||||||
gzip.c
|
gzip.c
|
||||||
init.c
|
init.c
|
||||||
kex.c
|
kex.c
|
||||||
keyfiles.c
|
|
||||||
keys.c
|
keys.c
|
||||||
known_hosts.c
|
known_hosts.c
|
||||||
legacy.c
|
legacy.c
|
||||||
@@ -104,6 +103,7 @@ set(libssh_SRCS
|
|||||||
packet.c
|
packet.c
|
||||||
pcap.c
|
pcap.c
|
||||||
pki.c
|
pki.c
|
||||||
|
pki_gcrypt.c
|
||||||
poll.c
|
poll.c
|
||||||
session.c
|
session.c
|
||||||
scp.c
|
scp.c
|
||||||
|
@@ -361,7 +361,7 @@ static int privatekey_dek_header(const char *header, unsigned int header_len,
|
|||||||
else /* calculate length */ \
|
else /* calculate length */ \
|
||||||
for(p += len, len = 0; p[len] && p[len] != '\n' \
|
for(p += len, len = 0; p[len] && p[len] != '\n' \
|
||||||
&& p[len] != '\r'; len++); \
|
&& p[len] != '\r'; len++); \
|
||||||
}
|
}
|
||||||
|
|
||||||
static ssh_buffer privatekey_string_to_buffer(const char *pkey, int type,
|
static ssh_buffer privatekey_string_to_buffer(const char *pkey, int type,
|
||||||
ssh_auth_callback cb, void *userdata, const char *desc) {
|
ssh_auth_callback cb, void *userdata, const char *desc) {
|
||||||
@@ -942,7 +942,7 @@ ssh_private_key privatekey_from_file(ssh_session session, const char *filename,
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
file = fopen(filename,"r");
|
file = fopen(filename,"r");
|
||||||
|
|
||||||
if (file == NULL) {
|
if (file == NULL) {
|
||||||
ssh_set_error(session, SSH_REQUEST_DENIED,
|
ssh_set_error(session, SSH_REQUEST_DENIED,
|
||||||
"Error opening %s: %s", filename, strerror(errno));
|
"Error opening %s: %s", filename, strerror(errno));
|
||||||
@@ -1280,10 +1280,10 @@ int ssh_publickey_to_file(ssh_session session, const char *file,
|
|||||||
size_t len;
|
size_t len;
|
||||||
int rc;
|
int rc;
|
||||||
if(session==NULL)
|
if(session==NULL)
|
||||||
return SSH_ERROR;
|
return SSH_ERROR;
|
||||||
if(file==NULL || pubkey==NULL){
|
if(file==NULL || pubkey==NULL){
|
||||||
ssh_set_error(session, SSH_FATAL, "Invalid parameters");
|
ssh_set_error(session, SSH_FATAL, "Invalid parameters");
|
||||||
return SSH_ERROR;
|
return SSH_ERROR;
|
||||||
}
|
}
|
||||||
pubkey_64 = bin_to_base64(pubkey->string, ssh_string_len(pubkey));
|
pubkey_64 = bin_to_base64(pubkey->string, ssh_string_len(pubkey));
|
||||||
if (pubkey_64 == NULL) {
|
if (pubkey_64 == NULL) {
|
@@ -1,7 +1,7 @@
|
|||||||
#define LIBSSH_STATIC
|
#define LIBSSH_STATIC
|
||||||
|
|
||||||
#include "torture.h"
|
#include "torture.h"
|
||||||
#include "keyfiles.c"
|
#include "pki_gcrypt.c"
|
||||||
|
|
||||||
#define LIBSSH_RSA_TESTKEY "libssh_testkey.id_rsa"
|
#define LIBSSH_RSA_TESTKEY "libssh_testkey.id_rsa"
|
||||||
#define LIBSSH_DSA_TESTKEY "libssh_testkey.id_dsa"
|
#define LIBSSH_DSA_TESTKEY "libssh_testkey.id_dsa"
|
||||||
|
Reference in New Issue
Block a user