24 #include "libssh/priv.h"
25 #ifdef HAVE_OPENSSL_EC_H
26 #include <openssl/ec.h>
28 #ifdef HAVE_OPENSSL_ECDSA_H
29 #include <openssl/ecdsa.h>
32 #include "libssh/crypto.h"
33 #include "libssh/ed25519.h"
35 #define MAX_PUBKEY_SIZE 0x100000
36 #define MAX_PRIVKEY_SIZE 0x400000
38 #define SSH_KEY_FLAG_EMPTY 0x0
39 #define SSH_KEY_FLAG_PUBLIC 0x0001
40 #define SSH_KEY_FLAG_PRIVATE 0x0002
43 enum ssh_keytypes_e type;
51 #elif HAVE_LIBMBEDCRYPTO
52 mbedtls_pk_context *rsa;
53 mbedtls_ecdsa_context *ecdsa;
58 #ifdef HAVE_OPENSSL_ECC
64 ed25519_pubkey *ed25519_pubkey;
65 ed25519_privkey *ed25519_privkey;
67 enum ssh_keytypes_e cert_type;
71 enum ssh_keytypes_e type;
72 enum ssh_digest_e hash_type;
77 gcry_sexp_t ecdsa_sig;
78 #elif defined HAVE_LIBCRYPTO
81 # ifdef HAVE_OPENSSL_ECC
86 #elif defined HAVE_LIBMBEDCRYPTO
88 struct mbedtls_ecdsa_sig ecdsa_sig;
90 ed25519_signature *ed25519_sig;
101 enum ssh_keytypes_e type);
110 int ssh_pki_import_signature_blob(
const ssh_string sig_blob,
116 unsigned char *digest,
120 int ssh_pki_export_pubkey_blob(
const ssh_key key,
122 int ssh_pki_import_pubkey_blob(
const ssh_string key_blob,
125 int ssh_pki_import_cert_blob(
const ssh_string cert_blob,