# SPDX-FileCopyrightText: 2025 Marco Ricci <software@the13thletter.info>
#
# SPDX-License-Identifier: Zlib
"""Test OpenSSH key loading and signing."""
from __future__ import annotations
import base64
import contextlib
import io
import re
import socket
import types
from typing import TYPE_CHECKING
import click
import click.testing
import hypothesis
import pytest
from hypothesis import strategies
import tests
from derivepassphrase import _types, ssh_agent, vault
from derivepassphrase._internals import cli_helpers
if TYPE_CHECKING:
from collections.abc import Iterable
from typing_extensions import Any, Buffer
class Parametrize(types.SimpleNamespace):
SSH_STRING_EXCEPTIONS = pytest.mark.parametrize(
['input', 'exc_type', 'exc_pattern'],
[
pytest.param(
'some string', TypeError, 'invalid payload type', id='str'
),
],
)
UINT32_EXCEPTIONS = pytest.mark.parametrize(
['input', 'exc_type', 'exc_pattern'],
[
pytest.param(
10000000000000000,
OverflowError,
'int too big to convert',
id='10000000000000000',
),
pytest.param(