mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-11 18:50:28 +09:00
Added pki.[ch] files as a new standard API for PKs
Right now it's just a wrapper to the existing calls but soon it's gona be the effective implementation and other calls will be wrappers.
This commit is contained in:
@@ -113,6 +113,7 @@ typedef struct ssh_message_struct* ssh_message;
|
|||||||
typedef struct ssh_pcap_file_struct* ssh_pcap_file;
|
typedef struct ssh_pcap_file_struct* ssh_pcap_file;
|
||||||
typedef struct ssh_private_key_struct* ssh_private_key;
|
typedef struct ssh_private_key_struct* ssh_private_key;
|
||||||
typedef struct ssh_public_key_struct* ssh_public_key;
|
typedef struct ssh_public_key_struct* ssh_public_key;
|
||||||
|
typedef struct ssh_key_struct* ssh_key;
|
||||||
typedef struct ssh_scp_struct* ssh_scp;
|
typedef struct ssh_scp_struct* ssh_scp;
|
||||||
typedef struct ssh_session_struct* ssh_session;
|
typedef struct ssh_session_struct* ssh_session;
|
||||||
typedef struct ssh_string_struct* ssh_string;
|
typedef struct ssh_string_struct* ssh_string;
|
||||||
@@ -405,7 +406,7 @@ LIBSSH_API void ssh_pcap_file_free(ssh_pcap_file pcap);
|
|||||||
LIBSSH_API ssh_pcap_file ssh_pcap_file_new(void);
|
LIBSSH_API ssh_pcap_file ssh_pcap_file_new(void);
|
||||||
LIBSSH_API int ssh_pcap_file_open(ssh_pcap_file pcap, const char *filename);
|
LIBSSH_API int ssh_pcap_file_open(ssh_pcap_file pcap, const char *filename);
|
||||||
|
|
||||||
LIBSSH_API int ssh_privatekey_type(ssh_private_key privatekey);
|
LIBSSH_API enum ssh_keytypes_e ssh_privatekey_type(ssh_private_key privatekey);
|
||||||
|
|
||||||
LIBSSH_API void ssh_print_hexa(const char *descr, const unsigned char *what, size_t len);
|
LIBSSH_API void ssh_print_hexa(const char *descr, const unsigned char *what, size_t len);
|
||||||
LIBSSH_API int ssh_scp_accept_request(ssh_scp scp);
|
LIBSSH_API int ssh_scp_accept_request(ssh_scp scp);
|
||||||
|
|||||||
@@ -99,6 +99,7 @@ set(libssh_SRCS
|
|||||||
options.c
|
options.c
|
||||||
packet.c
|
packet.c
|
||||||
pcap.c
|
pcap.c
|
||||||
|
pki.c
|
||||||
poll.c
|
poll.c
|
||||||
session.c
|
session.c
|
||||||
scp.c
|
scp.c
|
||||||
|
|||||||
@@ -333,7 +333,10 @@ void ssh_list_kex(ssh_session session, KEX *kex) {
|
|||||||
#ifdef DEBUG_CRYPTO
|
#ifdef DEBUG_CRYPTO
|
||||||
ssh_print_hexa("session cookie", kex->cookie, 16);
|
ssh_print_hexa("session cookie", kex->cookie, 16);
|
||||||
#endif
|
#endif
|
||||||
|
if(kex->methods==NULL){
|
||||||
|
ssh_log(session, SSH_LOG_RARE,"kex->methods is NULL");
|
||||||
|
return;
|
||||||
|
}
|
||||||
for(i = 0; i < 10; i++) {
|
for(i = 0; i < 10; i++) {
|
||||||
ssh_log(session, SSH_LOG_FUNCTIONS, "%s: %s",
|
ssh_log(session, SSH_LOG_FUNCTIONS, "%s: %s",
|
||||||
ssh_kex_nums[i], kex->methods[i]);
|
ssh_kex_nums[i], kex->methods[i]);
|
||||||
|
|||||||
@@ -641,8 +641,8 @@ static int privatekey_type_from_file(FILE *fp) {
|
|||||||
*
|
*
|
||||||
* @param[in] filename The filename of the the private key.
|
* @param[in] filename The filename of the the private key.
|
||||||
*
|
*
|
||||||
* @param[in] type The type of the private key. This could be TYPE_DSS or
|
* @param[in] type The type of the private key. This could be SSH_KEYTYPE_DSS or
|
||||||
* TYPE_RSA. Pass 0 to automatically detect the type.
|
* SSH_KEYTYPE_RSA. Pass 0 to automatically detect the type.
|
||||||
*
|
*
|
||||||
* @param[in] passphrase The passphrase to decrypt the private key. Set to null
|
* @param[in] passphrase The passphrase to decrypt the private key. Set to null
|
||||||
* if none is needed or it is unknown.
|
* if none is needed or it is unknown.
|
||||||
@@ -799,15 +799,15 @@ ssh_private_key privatekey_from_file(ssh_session session, const char *filename,
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief returns the type of a private key
|
* @brief returns the type of a private key
|
||||||
* @param privatekey[in] the private key handle
|
* @param[in] privatekey the private key handle
|
||||||
* @returns one of TYPE_RSA,TYPE_DSS,TYPE_RSA1
|
* @returns one of SSH_KEYTYPE_RSA,SSH_KEYTYPE_DSS,SSH_KEYTYPE_RSA1
|
||||||
* @returns 0 if the type is unknown
|
* @returns SSH_KEYTYPE_UNKNOWN if the type is unknown
|
||||||
* @see privatekey_from_file
|
* @see privatekey_from_file
|
||||||
* @see ssh_userauth_offer_pubkey
|
* @see ssh_userauth_offer_pubkey
|
||||||
*/
|
*/
|
||||||
int ssh_privatekey_type(ssh_private_key privatekey){
|
enum ssh_keytypes_e ssh_privatekey_type(ssh_private_key privatekey){
|
||||||
if (privatekey==NULL)
|
if (privatekey==NULL)
|
||||||
return 0;
|
return SSH_KEYTYPE_UNKNOWN;
|
||||||
return privatekey->type;
|
return privatekey->type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user