403Webshell
Server IP : 198.38.94.13  /  Your IP : 216.73.217.33
Web Server : Apache
System : Linux d4744.dxb1.stableserver.net 5.14.0-611.49.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Apr 21 16:39:08 EDT 2026 x86_64
User : revivere ( 1140)
PHP Version : 8.2.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /lib/python3.9/site-packages/ipaclient/plugins/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3.9/site-packages/ipaclient/plugins/__pycache__/otptoken_yubikey.cpython-39.opt-1.pyc
a

�ji��@s ddlZddlZddlmZmZmZddlmZmZddl	m
Z
mZmZddl
mZddlmZzddlZddlZWn ey�eed�d��Yn0ejr�eZed	�ed
�ed�ed�ed
�Ze�ZdZedd�Gdd�de��Zedd�Gdd�de��Ze�Gdd�de
��ZdS)�N)�_�api�IntEnum)�NotFound�SkipPluginModule)�Command�Method�Object)�Registry)�
classpropertyzpython-yubico is not installed.��reasonz
YubiKey Tokens
z
Manage YubiKey tokens.
zt
This code is an extension to the otptoken plugin and provides support for
reading/writing YubiKey tokens directly.
z
EXAMPLES:
zP
 Add a new token:
   ipa otptoken-add-yubikey --owner=jdoe --desc="My YubiKey"
ZotpT)Zno_failc@seZdZdZdS)�_fake_otptokenZotptokenN)�__name__�
__module__�__qualname__�name�rr�F/usr/lib/python3.9/site-packages/ipaclient/plugins/otptoken_yubikey.pyr;src@seZdZdZdZdS)�_fake_otptoken_add�otptoken_addTN)rrrr�NO_CLIrrrrr@srcs�eZdZed�Zedded�dd�fZeZedd��Z	e
e	�Zed	d
��Z
�fdd�Z�fd
d�Z�fdd�Zdd�Zdd�Z�ZS)�otptoken_add_yubikeyzAdd a new YubiKey OTP token.zslot?�slotzYubiKey slot)��)Zcli_nameZlabel�valuescCstj�d�tuS)Nr)rrZ
get_pluginr)�clsrrrZ__NO_CLI_getterSsz$otptoken_add_yubikey.__NO_CLI_gettercCs|jjjjS�N)rrr�api_version��selfrrrrYsz otptoken_add_yubikey.api_versionc#s8|jjj��D]
}|Vqtt|���D]
}|Vq(dSr)rrr�args�superr�get_args)r!�arg��	__class__rrr$]szotptoken_add_yubikey.get_argsc#sB|jjj��D]}|jdvr|Vqtt|���D]
}|Vq2dS)N)�type�ipatokenvendor�
ipatokenmodel�ipatokenserial�ipatokenotpalgorithm�ipatokenhotpcounter�ipatokenotpkeyZipatokentotpclockoffsetZipatokentotptimestep�	no_qrcodeZqrcode�version)rrr�optionsrr#r�get_options)r!�optionr&rrr2cs

z otptoken_add_yubikey.get_optionsc#s8|jjj��D]
}|Vqtt|���D]
}|Vq(dSr)rrrZ
output_paramsr#r�get_output_params)r!Zparamr&rrr4usz&otptoken_add_yubikey.get_output_paramscCs|jjj��Sr)rrr�outputr rrr�_iter_output{sz!otptoken_add_yubikey._iter_outputcOs�zt��}Wn�tjjyD}ztd|jd��WYd}~npd}~0tjjyv}zt|j	d��WYd}~n>d}~0t
y�}ztt|�dd��WYd}~n
d}~00|�dd�du�rz*|�
���}tddh�|��d|d<Wn"t�y
ttd�d��Yn0t�d	�}|��}|�||�d
|�d
���|�dd�|j||dd
�dd�|��D�}|jjjdg|�Rddt|j�t|� ��dd|dd�|��}	dD]"}
|
|	�di�v�r�|	d|
=�q�|d|	�di�d<|	S)NzNo YubiKey found: %srz:. Please install 'libyubikey' and 'libusb' packages first.rrrrzNo free YubiKey slot!��ipatokenotpdigitsZSERIAL_API_VISIBLET)rcSsi|]\}}|dvr||�qS))r0�descriptionZ
ipatokenownerZipatokendisabledZipatokennotbeforeZipatokennotafterr8r)�.0�k�vrrr�
<dictcomp>��z0otptoken_add_yubikey.forward.<locals>.<dictcomp>rZhotpZYubiCoZsha1)r(r)r*r+r,r-r.r/)Zurir.�result)!�yubicoZfind_yubikey�usbZcoreZUSBErrorr�strerrorZyubikeyZYubiKeyErrorr
�
ValueError�str�get�statusZ
valid_configs�sorted�
difference�
IndexErrorr�os�urandomZinit_configZmode_oath_hotpZget_default_ofZ
extended_flagZwrite_config�itemsZBackendZ	rpcclient�forward�unicodeZmodel�serial)r!r"�kwargsZyk�e�used�keyZcfgr1Zanswerr;rrrrM~sT$ (

��
�
�
zotptoken_add_yubikey.forward)rrrr�__doc__rZ
takes_optionsZhas_output_params�classmethodZ$_otptoken_add_yubikey__NO_CLI_getterrr�propertyrr$r2r4r6rM�
__classcell__rrr&rrFs$��

r)rJZsixZipalibrrrZ
ipalib.errorsrrZipalib.frontendrrr	Zipalib.plugabler
Zipalib.utilrZusb.corerAr@�ImportErrorZPY3rDrNrT�registerZtopicrrrrrrr�<module>s<���	�

Youez - 2016 - github.com/yon3zu
LinuXploit