|
DeterministicESPAsyncWebServer v6.27.1
Zero-allocation, bounded-execution async HTTP server for ESP32
|
SSH user-authentication layer (RFC 4252) - password method. More...
#include "network_drivers/presentation/ssh/auth/ssh_auth.h"#include "network_drivers/presentation/ssh/crypto/ssh_ecdsa.h"#include "network_drivers/presentation/ssh/crypto/ssh_ed25519.h"#include "network_drivers/presentation/ssh/crypto/ssh_rsa.h"#include "network_drivers/presentation/ssh/transport/ssh_packet.h"#include "network_drivers/presentation/ssh/transport/ssh_transport.h"#include <string.h>Go to the source code of this file.
Classes | |
| struct | SshAuthCtx |
Functions | |
| void | ssh_auth_set_password_cb (SshPasswordCb cb) |
| Install the password-verification callback (nullptr → all fail). | |
| void | ssh_auth_set_pubkey_cb (SshPubkeyCb cb) |
| Install the publickey-authorization callback (nullptr → all fail). | |
| int | ssh_auth_handle_service_request (const uint8_t *payload, size_t len, uint8_t *out, size_t *out_len, size_t cap) |
| Handle SSH_MSG_SERVICE_REQUEST; emit SERVICE_ACCEPT for ssh-userauth. | |
| int | ssh_auth_parse_request (const uint8_t *payload, size_t len, SshAuthReq *req) |
Parse an SSH_MSG_USERAUTH_REQUEST into req. | |
| int | ssh_auth_build_failure (uint8_t *out, size_t *out_len, size_t cap, bool partial) |
| Build SSH_MSG_USERAUTH_FAILURE advertising "password". | |
| int | ssh_auth_build_success (uint8_t *out, size_t *out_len, size_t cap) |
| Build SSH_MSG_USERAUTH_SUCCESS. | |
| int | ssh_auth_handle_request (uint8_t i, const uint8_t *payload, size_t len, uint8_t *out, size_t *out_len, size_t cap) |
Handle a USERAUTH_REQUEST end-to-end for slot i. | |
SSH user-authentication layer (RFC 4252) - password method.
Definition in file ssh_auth.cpp.
| void ssh_auth_set_password_cb | ( | SshPasswordCb | cb | ) |
Install the password-verification callback (nullptr → all fail).
Definition at line 30 of file ssh_auth.cpp.
References SshAuthCtx::pw_cb.
| void ssh_auth_set_pubkey_cb | ( | SshPubkeyCb | cb | ) |
Install the publickey-authorization callback (nullptr → all fail).
Definition at line 35 of file ssh_auth.cpp.
References SshAuthCtx::pk_cb.
| int ssh_auth_handle_service_request | ( | const uint8_t * | payload, |
| size_t | len, | ||
| uint8_t * | out, | ||
| size_t * | out_len, | ||
| size_t | cap | ||
| ) |
Handle SSH_MSG_SERVICE_REQUEST; emit SERVICE_ACCEPT for ssh-userauth.
out, or -1 if the service is not "ssh-userauth" or the message is malformed. Definition at line 194 of file ssh_auth.cpp.
References SSH_MSG_SERVICE_ACCEPT, and SSH_MSG_SERVICE_REQUEST.
Referenced by ssh_server_dispatch().
| int ssh_auth_parse_request | ( | const uint8_t * | payload, |
| size_t | len, | ||
| SshAuthReq * | req | ||
| ) |
Parse an SSH_MSG_USERAUTH_REQUEST into req.
Definition at line 222 of file ssh_auth.cpp.
References SshAuthReq::has_signature, SshAuthReq::is_password, SshAuthReq::is_pubkey, SshAuthReq::method, SshAuthReq::password, SshAuthReq::pk_algo, SshAuthReq::pk_blob, SshAuthReq::pk_blob_len, SshAuthReq::service, SshAuthReq::signature, SshAuthReq::signature_len, SshAuthReq::signed_prefix, SshAuthReq::signed_prefix_len, SSH_MSG_USERAUTH_REQUEST, and SshAuthReq::user.
Referenced by ssh_auth_handle_request().
| int ssh_auth_build_failure | ( | uint8_t * | out, |
| size_t * | out_len, | ||
| size_t | cap, | ||
| bool | partial | ||
| ) |
Build SSH_MSG_USERAUTH_FAILURE advertising "password".
Definition at line 285 of file ssh_auth.cpp.
References SSH_MSG_USERAUTH_FAILURE.
Referenced by ssh_auth_handle_request().
| int ssh_auth_build_success | ( | uint8_t * | out, |
| size_t * | out_len, | ||
| size_t | cap | ||
| ) |
Build SSH_MSG_USERAUTH_SUCCESS.
Definition at line 304 of file ssh_auth.cpp.
References SSH_MSG_USERAUTH_SUCCESS.
Referenced by ssh_auth_handle_request().
| int ssh_auth_handle_request | ( | uint8_t | i, |
| const uint8_t * | payload, | ||
| size_t | len, | ||
| uint8_t * | out, | ||
| size_t * | out_len, | ||
| size_t | cap | ||
| ) |
Handle a USERAUTH_REQUEST end-to-end for slot i.
Parses the request, checks "password" credentials via the installed callback, and writes either USERAUTH_SUCCESS or USERAUTH_FAILURE to out. On success the session is marked authenticated and advanced to the connection phase.
Definition at line 408 of file ssh_auth.cpp.
References SshSession::authed, SshAuthReq::is_password, SshAuthReq::is_pubkey, MAX_SSH_CONNS, SshAuthReq::password, SshSession::phase, SshAuthCtx::pw_cb, ssh_auth_build_failure(), ssh_auth_build_success(), ssh_auth_parse_request(), SSH_PHASE_OPEN, ssh_sess, and SshAuthReq::user.
Referenced by ssh_server_dispatch().