1
0
mirror of https://github.com/libssh2/libssh2.git synced 2026-10-24 03:48:58 +03:00

libssh2_sign_sk: add LIBSSH2_API attribute, document availability

Based on it having a public man page, it was likely meant to be a public
function. Mark it `LIBSSH2_API` to export it from the DLL on Windows.

Also move its public prototype next to userauth functions, since its
implemented in userauth.c (though not using the namespace).

Follow-up to ed439a29bb #698

Closes #1965
This commit is contained in:
Viktor Szakats
2026-06-03 10:56:05 +02:00
parent f0279a69b5
commit e0635ab4cf
3 changed files with 21 additions and 18 deletions

View File

@@ -95,3 +95,7 @@ pass in the PIN, or a function pointer to retrieve the PIN.
# RETURN VALUE
Return 0 on success or negative on failure.
# AVAILABILITY
Added in libssh2 1.11.0

View File

@@ -370,24 +370,6 @@ typedef struct _LIBSSH2_LISTENER LIBSSH2_LISTENER;
typedef struct _LIBSSH2_KNOWNHOSTS LIBSSH2_KNOWNHOSTS;
typedef struct _LIBSSH2_AGENT LIBSSH2_AGENT;
/* SK signature callback */
typedef struct _LIBSSH2_PRIVKEY_SK {
int algorithm;
uint8_t flags;
const char *application;
const unsigned char *key_handle;
size_t handle_len;
LIBSSH2_USERAUTH_SK_SIGN_FUNC(*sign_callback);
void **orig_abstract;
} LIBSSH2_PRIVKEY_SK;
int libssh2_sign_sk(LIBSSH2_SESSION *session,
unsigned char **sig,
size_t *sig_len,
const unsigned char *data,
size_t data_len,
void **abstract);
#ifndef LIBSSH2_NO_DEPRECATED
typedef struct _LIBSSH2_POLLFD {
unsigned char type; /* LIBSSH2_POLLFD_* below */
@@ -758,6 +740,22 @@ LIBSSH2_API int libssh2_userauth_publickey_sk(
LIBSSH2_USERAUTH_SK_SIGN_FUNC(*sign_callback),
void **abstract);
/* SK signature callback */
typedef struct _LIBSSH2_PRIVKEY_SK {
int algorithm;
uint8_t flags;
const char *application;
const unsigned char *key_handle;
size_t handle_len;
LIBSSH2_USERAUTH_SK_SIGN_FUNC(*sign_callback);
void **orig_abstract;
} LIBSSH2_PRIVKEY_SK;
LIBSSH2_API int libssh2_sign_sk(LIBSSH2_SESSION *session,
unsigned char **sig, size_t *sig_len,
const unsigned char *data, size_t data_len,
void **abstract);
#ifndef LIBSSH2_NO_DEPRECATED
LIBSSH2_DEPRECATED(1.2.0, "Use system poll() or select()")
LIBSSH2_API int libssh2_poll(LIBSSH2_POLLFD *fds, unsigned int nfds,

View File

@@ -931,6 +931,7 @@ static int sign_fromfile(LIBSSH2_SESSION *session,
return 0;
}
LIBSSH2_API
int libssh2_sign_sk(LIBSSH2_SESSION *session,
unsigned char **sig, size_t *sig_len,
const unsigned char *data, size_t data_len,