20#ifndef KIGIT_KNOWN_HOSTS_H_
21#define KIGIT_KNOWN_HOSTS_H_
58APIEXPORT std::array<uint8_t, 20>
HmacSha1(
const std::string& aKey,
const std::string& aData );
71 const wxString& aKeyType,
const std::string& aRawKey );
75 const wxString& aBase64Key );
#define APIEXPORT
Macros which export functions from a DLL/DSO.
APIEXPORT bool AddKnownHost(const HOST_KEY_FAILURE &aKey)
Append the refused key to KnownHostsPath(), creating the file and its folder when missing.
KNOWN_HOST_STATE
How a server's host key stands against known_hosts.
@ OTHER_KEY_TYPE
Entries name the host only with keys of other types.
@ MISMATCH
Entries name the host with another key of this type, and none with this one.
@ UNKNOWN
No entry names the host with a key of this type.
@ MATCH
An entry names the host with this key.
@ REVOKED
A @revoked entry carries this key.
APIEXPORT wxString Libgit2LegacyHome(int aRevision)
The home folder libgit2 1.5 reads .ssh/known_hosts under, which it has no option to report.
APIEXPORT wxString FormatKnownHostsLine(const wxString &aHost, int aPort, const wxString &aKeyType, const wxString &aBase64Key)
The known_hosts line ssh would write for a key, without a line ending.
APIEXPORT KNOWN_HOST_STATE LookupKnownHost(const wxString &aKnownHostsText, const wxString &aHost, int aPort, const wxString &aKeyType, const std::string &aRawKey)
Classify a server's key against the text of a known_hosts file, as OpenSSH reads it.
APIEXPORT wxString ReadKnownHosts()
The text of KnownHostsPath(). Empty when it is missing or cannot be read.
APIEXPORT bool MayOfferTrust(const HOST_KEY_FAILURE &aFailure, bool aRetriedAfterTrust)
Whether the user may be asked to trust a refused key.
APIEXPORT wxString HostKeyType(const std::string &aRawKey)
The type a raw SSH key names for itself, such as ssh-ed25519. Empty when the key is malformed.
APIEXPORT wxString HostKeyFingerprint(const std::string &aRawKey)
SHA256 of a raw key in unpadded base64, as ssh shows it after "SHA256:".
APIEXPORT wxString HostKeyRefusalMessage(const HOST_KEY_FAILURE &aFailure)
Why a key the user may not trust was refused, and what to do next.
APIEXPORT std::array< uint8_t, 20 > HmacSha1(const std::string &aKey, const std::string &aData)
HMAC-SHA1 (RFC 2104), as OpenSSH hashes host names in known_hosts.
APIEXPORT wxString KnownHostsPath()
The known_hosts file libgit2 checks host keys against. Empty when it has no home folder.
A server key the connection refused, for the UI to offer to trust or to report.
wxString keyType
As known_hosts names it, such as ssh-ed25519.
wxString fingerprint
SHA256 in unpadded base64, as ssh shows it after "SHA256:".
std::string rawKey
The key as the server sent it.