ó
    b²Çh´  ã                   ót   • S r SSKJrJrJr  SSKJr  SSKJr  SSKJr  \(       a  SSK	J
r
  S	r " S
 S	\5      rg)z&SHA256 Password Authentication Plugin.é    )ÚTYPE_CHECKINGÚAnyÚOptionalé   )Úerrors)Úloggeré   )ÚMySQLAuthPlugin)ÚMySQLSocketÚMySQLSHA256PasswordAuthPluginc                   óŒ   • \ rS rSrSrS\4S jr\S\4S j5       r	\S\
4S j5       rS\S\S\\   4S	 jrS
SS\S\S\4S jrSrg)r   é+   zºClass implementing the MySQL SHA256 authentication plugin

Note that encrypting using RSA is not supported since the Python
Standard Library does not provide this OpenSSL functionality.
Úreturnc                 ó<   • U R                   R                  5       S-   $ )zaPrepare and return password as as clear text.

Returns:
    password (bytes): Prepared password.
ó    )Ú	_passwordÚencode©Úselfs    Úp/var/www/home/psychics-availability/venv/lib/python3.13/site-packages/mysql/connector/plugins/sha256_password.pyÚ_prepare_passwordÚ/MySQLSHA256PasswordAuthPlugin._prepare_password2   s   € ð ~‰~×$Ñ$Ó&¨Ñ0Ð0ó    c                 ó   • g)zPlugin official name.Úsha256_password© r   s    r   ÚnameÚ"MySQLSHA256PasswordAuthPlugin.name:   s   € ð !r   c                 ó   • g)z'Signals whether or not SSL is required.Tr   r   s    r   Úrequires_sslÚ*MySQLSHA256PasswordAuthPlugin.requires_ssl?   s   € ð r   Ú	auth_dataÚkwargsc                 ó¬   • U R                   (       a4  U R                  (       d#  [        R                  " U R                   S35      eU R                  5       $ )z›Return the prepared password to send to MySQL.

Raises:
    InterfaceError: When SSL is required by not enabled.

Returns:
    str: The prepared password.
z requires SSL)r    Ússl_enabledr   ÚInterfaceErrorr   r   )r   r"   r#   s      r   Úauth_responseÚ+MySQLSHA256PasswordAuthPlugin.auth_responseD   s@   € ð ×× T×%5×%5Ü×'Ò'¨4¯9©9¨+°]Ð(CÓDÐDØ×%Ñ%Ó'Ð'r   Úsockr   c                 ó"  • U R                   " U40 UD6nUc  [        R                  " S5      e[        R                  " SU[        U5      5        UR                  U5        [        UR                  5       5      n[        R                  " SU5        U$ )aû  Handles server's `auth switch request` response.

Args:
    sock: Pointer to the socket connection.
    auth_data: Plugin provided data (extracted from a packet
               representing an `auth switch request` response).
    kwargs: Custom configuration to be passed to the auth plugin
            when invoked. The parameters defined here will override the ones
            defined in the auth plugin itself.

Returns:
    packet: Last server's response after back-and-forth
            communication.
zGot a NULL auth responsez# request: %s size: %sz# server response packet: %s)	r'   r   r&   r   ÚdebugÚlenÚsendÚbytesÚrecv)r   r)   r"   r#   ÚresponseÚpkts         r   Úauth_switch_responseÚ2MySQLSHA256PasswordAuthPlugin.auth_switch_responseQ   sv   € ð" ×%Ò% iÑ:°6Ñ:ˆØÑÜ×'Ò'Ð(BÓCÐCäŠÐ-¨x¼¸X»ÔGØ	‰	(ÔäD—I‘I“KÓ ˆÜŠÐ3°SÔ9àˆ
r   r   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r.   r   ÚpropertyÚstrr   Úboolr    r   r   r'   r2   Ú__static_attributes__r   r   r   r   r   +   sŒ   † ñð1 5ô 1ð ð!có !ó ð!ð ð˜dó ó ðð( uð (¸ð (ÀÈÁô (ðØ!ðØ.3ðØ?Bðà	÷r   N)r8   Útypingr   r   r   Ú r   r   r
   Únetworkr   ÚAUTHENTICATION_PLUGIN_CLASSr   r   r   r   Ú<module>rA      s3   ðñ: -ç /Ñ /å Ý Ý æÝ%à=Ð ôA Oõ Ar   