ssh_auth_public_key.h File Reference

Public key authentication method. More...

#include "ssh/ssh.h"

Go to the source code of this file.

Functions

error_t sshSendUserAuthPkOk (SshConnection *connection, const SshString *publicKeyAlgo, const SshBinaryString *publicKey)
 Send SSH_MSG_USERAUTH_PK_OK message. More...
 
error_t sshFormatPublicKeyAuthParams (SshConnection *connection, const uint8_t *message, size_t messageLen, uint8_t *p, size_t *written)
 Format "publickey" method specific fields. More...
 
error_t sshFormatUserAuthPkOk (SshConnection *connection, const SshString *publicKeyAlgo, const SshBinaryString *publicKey, uint8_t *p, size_t *length)
 Format SSH_MSG_USERAUTH_PK_OK message. More...
 
error_t sshParsePublicKeyAuthParams (SshConnection *connection, const SshString *userName, const uint8_t *message, const uint8_t *p, size_t length)
 Parse "publickey" method specific fields. More...
 
error_t sshParseUserAuthPkOk (SshConnection *connection, const uint8_t *message, size_t length)
 Parse SSH_MSG_USERAUTH_PK_OK message. More...
 

Detailed Description

Public key authentication method.

License

SPDX-License-Identifier: GPL-2.0-or-later

Copyright (C) 2019-2024 Oryx Embedded SARL. All rights reserved.

This file is part of CycloneSSH Open.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Author
Oryx Embedded SARL (www.oryx-embedded.com)
Version
2.4.4

Definition in file ssh_auth_public_key.h.

Function Documentation

◆ sshFormatPublicKeyAuthParams()

error_t sshFormatPublicKeyAuthParams ( SshConnection connection,
const uint8_t *  message,
size_t  messageLen,
uint8_t *  p,
size_t *  written 
)

Format "publickey" method specific fields.

Parameters
[in]connectionPointer to the SSH connection
[in]messagePointer to the message to be signed
[out]messageLenLength of the message, in bytes
[out]pOutput stream where to write the method specific fields
[out]writtenTotal number of bytes that have been written
Returns
Error code

Definition at line 107 of file ssh_auth_public_key.c.

◆ sshFormatUserAuthPkOk()

error_t sshFormatUserAuthPkOk ( SshConnection connection,
const SshString publicKeyAlgo,
const SshBinaryString publicKey,
uint8_t *  p,
size_t *  length 
)

Format SSH_MSG_USERAUTH_PK_OK message.

Parameters
[in]connectionPointer to the SSH connection
[in]publicKeyAlgoPublic key algorithm name
[in]publicKeyPublic key blob from the authentication request
[out]pBuffer where to format the message
[out]lengthLength of the resulting message, in bytes
Returns
Error code

Definition at line 215 of file ssh_auth_public_key.c.

◆ sshParsePublicKeyAuthParams()

error_t sshParsePublicKeyAuthParams ( SshConnection connection,
const SshString userName,
const uint8_t *  message,
const uint8_t *  p,
size_t  length 
)

Parse "publickey" method specific fields.

Parameters
[in]connectionPointer to the SSH connection
[in]userNamePointer to the user name
[in]messagePointer to the SSH_MSG_USERAUTH_REQUEST message
[in]pPointer to method specific fields
[in]lengthLength of the method specific fields, in bytes
Returns
Error code

Definition at line 272 of file ssh_auth_public_key.c.

◆ sshParseUserAuthPkOk()

error_t sshParseUserAuthPkOk ( SshConnection connection,
const uint8_t *  message,
size_t  length 
)

Parse SSH_MSG_USERAUTH_PK_OK message.

Parameters
[in]connectionPointer to the SSH connection
[in]messagePointer to message
[in]lengthLength of the message, in bytes
Returns
Error code

Definition at line 443 of file ssh_auth_public_key.c.

◆ sshSendUserAuthPkOk()

error_t sshSendUserAuthPkOk ( SshConnection connection,
const SshString publicKeyAlgo,
const SshBinaryString publicKey 
)

Send SSH_MSG_USERAUTH_PK_OK message.

Parameters
[in]connectionPointer to the SSH connection
[in]publicKeyAlgoPublic key algorithm name
[in]publicKeyPublic key blob from the authentication request
Returns
Error code

Definition at line 62 of file ssh_auth_public_key.c.