1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
Ë
WñúhÜ*ãó*—dZddlmZmZmZmZddlmZmZddl    m    Z    ddl
m Z erddl m Z     dd    lmZdd
lmZmZdd lmZdd lmZ    ddlmZdZdZGd„de«Z Gd„de «Z!y#e$rZej4d «e‚dZ[wwxYw#e$rdZYŒBwxYw)zWebAuthn Authentication Plugin.é)Ú TYPE_CHECKINGÚAnyÚCallableÚOptional)ÚerrorsÚutilsé)Úloggeré)ÚMySQLAuthPlugin)Ú MySQLSocket)Ú
dump_bytes)Ú Fido2ClientÚUserInteraction)Ú CtapHidDevice)Ú!PublicKeyCredentialRequestOptionszxModule fido2 is required for WebAuthn authentication mechanism but was not found. Unable to authenticate with the serverN)ÚCtapPcscDeviceTFÚMySQLWebAuthnAuthPlugincó,—eZdZdZddeefd„Zdd„Zy)ÚClientInteractionz(Provides user interaction to the Client.NÚcallbackcó —||_d|_y)NzTPlease insert FIDO device and perform gesture action for authentication to complete.)rÚmsg)Úselfrs  úmH:\Change_password\venv_build\Lib\site-packages\mysql/connector/aio/plugins/authentication_webauthn_client.pyÚ__init__zClientInteraction.__init__Cs€Ø ˆŒ ð ð     ócó~—|j€t|j«y|j|j«y)z=Prompt message for the user interaction with the FIDO device.N)rÚprintr©rs rÚ    prompt_upzClientInteraction.prompt_upJs'€à =‰=Ð  Ü $—(‘(Oà M‰M˜$Ÿ(™(Õ #r©N)ÚreturnN)Ú__name__Ú
__module__Ú __qualname__Ú__doc__rrrr!©rrrr@s„Ù2ñ
 ¨(Ñ!3ó
ô$rrcóà—eZdZUdZdZeeed<dZee    ed<ddgdœZ
e ed<e de fd„«Ze defd    „«Z    dd
eedefd „Zd ed edeefd„Zddd ed edefd„Zddd ed edefd„Zy)rz<Class implementing the MySQL WebAuthn authentication plugin.NÚclientr)ÚrpIdÚ    challengeÚallowCredentialsÚoptionsr#có—y)zPlugin official name.Úauthentication_webauthn_clientr(r s rÚnamezMySQLWebAuthnAuthPlugin.nameYs€ð0rcó—y)z'Signals whether or not SSL is required.Fr(r s rÚ requires_sslz$MySQLWebAuthnAuthPlugin.requires_ssl^s€ðrÚ credential_idcó—|j€tjd«‚||ddœg|jd<|jj    t j |j««}t|j««}d}tjd«}|tj|«z }t|«D]Œ}|j|«}t|j«}|j}    |tjt|««z }||z }|tjt|    ««z }||    z }|j }ŒŽ|tjt|««z }||z }t#j$d|«|S)zôGet assertion from authenticator and return the response.
 
        Args:
            credential_id (Optional[bytearray]): The credential ID.
 
        Returns:
            bytearray: The response packet with the data from the assertion.
        zNo WebAuthn client foundz
public-key)ÚidÚtyper-rr    z&WebAuthn - payload response packet: %s)r*rÚInterfaceErrorr.Ú get_assertionrÚ    from_dictÚlenÚget_assertionsrÚlc_intÚrangeÚ get_responseÚcbor_dump_bytesÚauthenticator_dataÚ    signatureÚ client_datar
Údebug)
rr4Ú    assertionÚnumber_of_assertionsÚclient_data_jsonÚpacketÚiÚassertion_responserArBs
          rÚget_assertion_responsez.MySQLWebAuthnAuthPlugin.get_assertion_responsecs€ð ;‰;Ð Ü×'Ñ'Ð(BÓCÐ Cà Ð $ð
(Ø(ñð0ˆDL‰LÐ+Ñ ,ð—K‘K×-Ñ-Ü -× 7Ñ 7¸¿ ¹ Ó Eó
ˆ    ô # 9×#;Ñ#;Ó#=Ó>ÐØÐô—‘˜a“ˆØ”%—,‘,Ð3Ó4Ñ4ˆôÐ+Ó,ò    >ˆAØ!*×!7Ñ!7¸Ó!:Ð ô"1Ð1C×1VÑ1VÓ!WÐ ð+×4Ñ4ˆIà ”e—l‘l¤3Ð'9Ó#:Ó;Ñ ;ˆFØ Ð(Ñ (ˆFØ ”e—l‘l¤3 y£>Ó2Ñ 2ˆFØ iÑ ˆFð 2×=Ñ=Ñ ð    >ð"    ”%—,‘,œsÐ#3Ó4Ó5Ñ5ˆØÐ"Ñ"ˆä ‰ Ð=¸vÔF؈ rÚ    auth_dataÚkwargsc óÈ—    tj|d«\}}tj|«\}}||jd<|j    «|jd<t j d|«t j d|jd«t j d|jd«ttj«d«}|t j d    «n$trttj«d«}|€tjd
«‚t|d |jd›t!|j"«¬ «|_|j$j&jj)d «st j d«yt j d«y#t$r}tjd«|‚d}~wwxYw)aEFind authenticator device and check if supports resident keys.
 
        It also creates a Fido2Client using the relying party ID from the server.
 
        Raises:
            InterfaceError: When the FIDO device is not found.
 
        Returns:
            bytes: 2 if the authenticator supports resident keys else 1.
        r r,r+zWebAuthn - capability: %dzWebAuthn - challenge: %szWebAuthn - relying party id: %sz2Unable to parse MySQL WebAuthn authentication dataNzWebAuthn - Use USB HID channelzNo FIDO device foundzhttps://)Úuser_interactionÚrkz6WebAuthn - Authenticator doesn't support resident keysó1z<WebAuthn - Authenticator with support for resident key foundó2)rÚread_intÚread_lc_string_listr.Údecoder
rDÚ
ValueErrorrr8ÚnextrÚ list_devicesÚCTAP_PCSC_DEVICE_AVAILABLErrrrr*ÚinfoÚget)    rrLrMÚpacketsÚ
capabilityr,Úrp_idÚerrÚdevices             rÚ auth_responsez%MySQLWebAuthnAuthPlugin.auth_response©s‡€ð     Ü"'§.¡.°¸AÓ">Ñ ˆGZÜ$×8Ñ8¸ÓAÑ ˆIuØ(1ˆDL‰L˜Ñ %Ø#(§<¡<£>ˆDL‰L˜Ñ  Ü L‰LÐ4°jÔ AÜ L‰LÐ3°T·\±\À+Ñ5NÔ OÜ L‰LÐ:¸D¿L¹LÈÑ<PÔ Qô”m×0Ñ0Ó2°DÓ9ˆØ Ð Ü L‰LÐ9Õ :Ý 'Üœ.×5Ñ5Ó7¸Ó>ˆFà ˆ>Ü×'Ñ'Ð(>Ó?Ð ?ô"Ø Øt—|‘| FÑ+Ð,Ð -Ü.¨t¯}©}Ó=ô
ˆŒ ð {‰{×Ñ×'Ñ'×+Ñ+¨DÔ1Ü L‰LÐQÔ RØä ‰ ÐSÔTØøô7ò    Ü×'Ñ'ØDóàð ûð    ús‚B9F=Æ=    G!ÇGÇG!Úsockr c‹óHK—tj|«\}}|j|«}tjd|t |««|j |«ƒd{–—†t|j«ƒd{–—†«}tjd|«|S7Œ=7Œ"­w)aEHandles server's `auth more data` response.
 
        Args:
            sock: Pointer to the socket connection.
            auth_data: Authentication method data (from a packet representing
                       an `auth more data` 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.
        úWebAuthn - request: %s size: %sNú%WebAuthn - server response packet: %s)    rÚread_lc_stringrKr
rDr;ÚwriteÚbytesÚread)rrbrLrMÚ_r4ÚresponseÚpkts        rÚauth_more_responsez*MySQLWebAuthnAuthPlugin.auth_more_responseÙs„èø€ô"!×/Ñ/°    Ó:шˆ=à×.Ñ.¨}Ó=ˆä ‰ Ð6¸Ä#ÀhÃ-ÔP؏j‰j˜Ó"×"Ð"ä˜$Ÿ)™)›+×%Ó&ˆÜ ‰ Ð<¸cÔBàˆ
ð     #øà%ús$‚AB"Á BÁ!B"Á=B Á>!B" B"c‹óÆK—|jd«xs|jd«}t|t«rtj|«n||_|j |«}d}|dk(rktjd«|jtjt|«««ƒd{–—†t|j«ƒd{–—†«S|j|«}tjd|t|««|j|«ƒd{–—†t|j«ƒd{–—†«}tjd|«|S7Œ¨7Œ7ŒA7Œ&­w)aSHandles 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.
        Úwebauthn_callbackÚ fido_callbackNrQz WebAuthn - request credential_idrdre)r[Ú
isinstanceÚstrrÚ import_objectrrar
rDrgr=ÚintrhrirKr;)rrbrLrMÚwebauth_callbackrkr4rls        rÚauth_switch_responsez,MySQLWebAuthnAuthPlugin.auth_switch_responseös'èø€ð""Ÿ:™:Ð&9Ó:ò
¸f¿j¹jØ ó?
Ðô
Ð*¬CÔ0ô × Ñ Р0Ô 1à!ð     Œ ð ×%Ñ% iÓ0ˆØˆ à tÒ ä L‰LÐ;Ô <Ø—*‘*œUŸ\™\¬#¨h«-Ó8Ó9× 9Ð 9ô˜tŸy™y›{×*Ó+Ð +à×.Ñ.¨}Ó=ˆä ‰ Ð6¸Ä#ÀhÃ-ÔP؏j‰j˜Ó"×"Ð"ä˜$Ÿ)™)›+×%Ó&ˆÜ ‰ Ð<¸cÔBàˆ
ð :øð+øð
    #øà%úsI‚B.E!Â0EÂ1E!à EÃA E!ÄEÄE!Ä8EÄ9!E!ÅE!ÅE!ÅE!r")r$r%r&r'r*rrÚ__annotations__rrr.ÚdictÚpropertyrrr1Úboolr3Ú    bytearrayrhrKrrarmrvr(rrrrRsô…ÙFà$(€FˆH[Ñ !Ó(Ø#'€HˆhxÑ Ó'Ø!°È"ÑM€GˆTÓMà ð0cò0óð0ðð˜dòóðð
48ñDØ% iÑ0ðDà    óDðL. uð.¸ð.ÀÈÁó.ð`Ø!ðØ.3ðØ?Bðà    óð:-Ø!ð-Ø.3ð-Ø?Bð-à    ô-r)"r'ÚtypingrrrrÚmysql.connectorrrr
Úr Únetworkr Ú
fido2.cborrr@Ú fido2.clientrrÚ    fido2.hidrÚfido2.webauthnrÚ ImportErrorÚ
import_errÚProgrammingErrorÚ
fido2.pcscrrYÚModuleNotFoundErrorÚAUTHENTICATION_PLUGIN_CLASSrrr(rrú<module>rŠsªðñ:&÷:Ó9ç)åÝáÝ%ð    Ý8ß9Ý'Ý@ð'Ý)à!%Ðð
8Ðô$˜ô$ô$Q˜oõQøðGòØ
!ˆ&×
!ð    <ó ð ðûðûðò'Ø!&Òð'ús)¬A(ÁBÁ(BÁ-BÂBÂBÂB