mirror of
https://github.com/libssh2/libssh2.git
synced 2025-07-29 13:01:14 +03:00
Agent forwarding implementation (#752)
This PR contains a series of patches that date back many years and I believe were discussed on the mailing list, but never merged. We have been using these in our local copy of libssh2 without issue since 2015, if not earlier. I believe this is the full set of changes, as we tried to use comments to mark where our copy of libssh2 differs from the canonical version. This also contains changes I made earlier this year, but which were not discussed on the mailing list, to support certificates and FIDO2 keys with agent forwarding. Note that this is not a complete implementation of agent forwarding, as that is outside the scope of libssh2. Clients still need to provide their own implementation that parses ssh-agent methods after calling libssh2_channel_read() and calls the appropriate callback messages in libssh2. See the man page changes in this PR for more details. Integration-patches-by: Viktor Szakats * prefer size_t * prefer unsigned int over u_int in public function * add const * docs, indent, checksrc, debug call, compiler warning fixes
This commit is contained in:
52
docs/libssh2_agent_sign.3
Normal file
52
docs/libssh2_agent_sign.3
Normal file
@ -0,0 +1,52 @@
|
||||
.TH libssh2_agent_sign 3 "1 Oct 2022" "libssh2 1.11.0" "libssh2 manual"
|
||||
.SH NAME
|
||||
libssh2_agent_sign - sign data, with the help of ssh-agent
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <libssh2.h>
|
||||
|
||||
int
|
||||
libssh2_agent_sign(LIBSSH2_AGENT *agent,
|
||||
struct libssh2_agent_publickey *identity,
|
||||
unsigned char **sig,
|
||||
size_t *s_len,
|
||||
const unsigned char *data,
|
||||
size_t d_len,
|
||||
const char *method,
|
||||
unsigned int method_len);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
\fIagent\fP - ssh-agent handle as returned by
|
||||
.BR libssh2_agent_init(3)
|
||||
|
||||
\fIidentity\fP - Public key to authenticate with, as returned by
|
||||
.BR libssh2_agent_get_identity(3)
|
||||
|
||||
\fIsig\fP - A pointer to a buffer in which to place the signature. The caller
|
||||
is responsible for freeing the signature with LIBSSH2_FREE.
|
||||
|
||||
\fIs_len\fP - A pointer to the length of the sig parameter.
|
||||
|
||||
\fIdata\fP - The data to sign.
|
||||
|
||||
\fId_len\fP - The length of the data parameter.
|
||||
|
||||
\fImethod\fP - A buffer indicating the signing method. This should match the
|
||||
string at the start of identity->blob.
|
||||
|
||||
\fImethod_len\fP - The length of the method parameter.
|
||||
|
||||
Sign data using an ssh-agent. This function can be used in a callback
|
||||
registered with libssh2_session_callback_set(3) using
|
||||
LIBSSH2_CALLBACK_AUTHAGENT_SIGN to sign an authentication challenge from a
|
||||
server. However, the client is responsible for implementing the code that calls
|
||||
this callback in response to a SSH2_AGENTC_SIGN_REQUEST message.
|
||||
.SH RETURN VALUE
|
||||
Returns 0 if succeeded, or a negative value for error.
|
||||
.SH AVAILABILITY
|
||||
Added in libssh2 1.11.0
|
||||
.SH SEE ALSO
|
||||
.BR libssh2_agent_init(3)
|
||||
.BR libssh2_agent_get_identity(3)
|
||||
.BR libssh2_agent_userauth(3)
|
||||
.BR libssh2_session_callback_set(3)
|
Reference in New Issue
Block a user