File: //usr/local/CyberPanel/lib64/python3.10/site-packages/asyncssh/__pycache__/rsa.cpython-310.pyc
o
�h�, �
@ sX d Z ddlmZmZmZmZ ddlmZmZm Z m
Z
ddlmZm
Z
ddlmZ ddlmZmZmZ ddlmZmZmZ dd lmZmZ dd
lmZ ddd
dddd
ddd� Zeeeeeeeeef Zeeeeeeeeeef Zeeef Z da!deddfdd�Z"G dd� de�Z#ede#d� e#j$D ]
Z%ede%e%d e#ed� q�e#j&D ]Z%ee%d� q�dS )z!RSA public key encryption handler� )�Optional�Tuple�Union�cast� )�ASN1DecodeError�ObjectIdentifier�
der_encode�
der_decode)�
RSAPrivateKey�RSAPublicKey)�all_ints)�MPInt�String� SSHPacket)�SSHKey�SSHOpenSSHCertificateV01�KeyExportError)�register_public_key_alg�register_certificate_alg)�register_x509_certificate_alg�sha1�sha256�sha512�sha224�sha384) � ssh-rsa� rsa-sha2-256� rsa-sha2-512� ssh-rsa-sha224@ssh.com� ssh-rsa-sha256@ssh.com� ssh-rsa-sha384@ssh.com� ssh-rsa-sha512@ssh.coms rsa1024-sha1� rsa2048-sha256F�skip_validation�returnNc C s | a dS )a\ Set whether to disable RSA key validation in OpenSSL
OpenSSL 3.x does additional validation when loading RSA keys
as an added security measure. However, the result is that
loading a key can take significantly longer than it did before.
If all your RSA keys are coming from a trusted source, you can
call this function with a value of `True` to default to skipping
these checks on RSA keys, reducing the cost back down to what it
was in earlier releases.
This can also be set on a case by case basis by using the new
`unsafe_skip_rsa_key_validation` argument on the functions used
to load keys. This will only affect loading keys of type RSA.
.. note:: The extra cost only applies to loading existing keys, and
not to generating new keys. Also, in cases where a key is
used repeatedly, it can be loaded once into an `SSHKey`
object and reused without having to pay the cost each time.
So, this call should not be needed in most applications.
If an application does need this, it is strongly
recommended that the `unsafe_skip_rsa_key_validation`
argument be used rather than using this function to
change the default behavior for all load operations.
N)� _default_skip_rsa_key_validation)r$ � r'