git.schokokeks.org
Repositories
Help
Report an Issue
fakesshagent.git
Code
Commits
Branches
Tags
Suche
Strukturansicht:
c0052c7
Branches
Tags
documentation-tree
master
unstable/sans-io
wishlist
0.1
fakesshagent.git
src
fakesshagent
_types.py
Sketch events for Sans-I/O version
Marco Ricci
commited
c0052c7
at 2026-09-14 16:33:20
_types.py
Blame
History
Raw
# SPDX-FileCopyrightText: 2026 Marco Ricci <software@the13thletter.info> # # SPDX-License-Identifier: Zlib """Types for the fake SSH agent.""" from __future__ import annotations import enum class SSH_AGENTC(int, enum.Enum): # noqa: N801 """SSH agent protocol numbers: client requests. Attributes: REQUEST_IDENTITIES (int): List identities. Expecting [`SSH_AGENT.IDENTITIES_ANSWER`][]. SIGN_REQUEST (int): Sign data. Expecting [`SSH_AGENT.SIGN_RESPONSE`][]. ADD_IDENTITY (int): Add an (SSH2) identity to the agent. REMOVE_IDENTITY (int): Remove an (SSH2) identity from the agent. REMOVE_ALL_IDENTITIES (int): Remove all identities held by the agent. ADD_SMARTCARD_KEY (int): Add an (SSH2) identity on a hardware token to the agent's list of keys. (The key does not leave the hardware token.) REMOVE_SMARTCARD_KEY (int): Remove an (SSH2) identity on a hardware token from the agent's list of keys. (The key is not removed from the hardware token.) LOCK (int): Lock the agent with a passphrase, preventing adding and signing operations until unlocked. UNLOCK (int): Attempt to unlock the agent with the given passphrase. ADD_ID_CONSTRAINED (int): Add an (SSH2) identity, including key constraints. ADD_SMARTCARD_KEY_CONSTRAINED (int): Add an (SSH2) identity on a hardware token, including key constraints, to the agent's list of keys. (The key does not leave the hardware token.) EXTENSION (int): Issue a named request that isn't part of the core agent protocol. Expecting [`SSH_AGENT.EXTENSION_RESPONSE`][] or [`SSH_AGENT.EXTENSION_FAILURE`][] if the named request is supported, [`SSH_AGENT.FAILURE`][] otherwise. """ REQUEST_IDENTITIES = 11 """""" SIGN_REQUEST = 13 """""" ADD_IDENTITY = 17 """""" REMOVE_IDENTITY = 18 """""" REMOVE_ALL_IDENTITIES = 19 """""" ADD_SMARTCARD_KEY = 20 """""" REMOVE_SMARTCARD_KEY = 21 """""" LOCK = 22 """""" UNLOCK = 23 """""" ADD_ID_CONSTRAINED = 25 """""" ADD_SMARTCARD_KEY_CONSTRAINED = 26 """""" EXTENSION = 27 """""" def __bytes__(self) -> bytes: # pragma: no cover [unused] """Return the corresponding request code.""" return int.to_bytes(self, 1, "big", signed=False) class SSH_AGENT(int, enum.Enum): # noqa: N801 """SSH agent protocol numbers: server replies. Attributes: FAILURE (int): Generic failure code. SUCCESS (int): Generic success code. IDENTITIES_ANSWER (int): Successful answer to [`SSH_AGENTC.REQUEST_IDENTITIES`][]. SIGN_RESPONSE (int): Successful answer to [`SSH_AGENTC.SIGN_REQUEST`][]. EXTENSION_FAILURE (int): Unsuccessful answer to [`SSH_AGENTC.EXTENSION`][]. EXTENSION_RESPONSE (int): Successful answer to [`SSH_AGENTC.EXTENSION`][]. """ FAILURE = 5 """""" SUCCESS = 6 """""" IDENTITIES_ANSWER = 12 """""" SIGN_RESPONSE = 14 """""" EXTENSION_FAILURE = 28 """""" EXTENSION_RESPONSE = 29 """""" def __bytes__(self) -> bytes: # pragma: no cover [unused] """Return the corresponding response code.""" return int.to_bytes(self, 1, "big", signed=False)