HEX
Server: LiteSpeed
System: Linux shams.tasjeel.ae 5.14.0-611.5.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Nov 11 08:09:09 EST 2025 x86_64
User: infowars (1469)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: //lib/python3.9/site-packages/yubico/__pycache__/yubikey_config_util.cpython-39.pyc
a

�w\��@s`dZgd�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd	�d	e�ZGd
d�de�ZdS)
z+
utility functions used in yubikey_config.
)�YubiKeyConfigBits�YubiKeyConfigFlag�YubiKeyExtendedFlag�YubiKeyTicketFlagc@sVeZdZdZdddgd�fdd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
dS)�YubiKeyFlagz0
    A flag value, and associated metadata.
    N��r)ZYubiKeyzYubiKey NEOz	YubiKey 4cCsxt|�turdsJ�t|�tur(ds(J�t|�tur<ds<J�t|�turPdsPJ�||_||_||_||_||_	||_
dS)a�
        Metadata about a ticket/config/extended flag bit.

        @param key: Name of flag, such as 'APPEND_CR'
        @param value: Bit value, 0x20 for APPEND_CR
        @param doc: Human readable description of flag
        @param min_ykver: Tuple with the minimum version required (major, minor,)
        @param min_ykver: Tuple with the maximum version required (major, minor,) (for depreacted flags)
        @param models: List of model identifiers (strings) that support this flag
        �N)�type�str�int�tuple�list�key�value�doc�	min_ykver�	max_ykver�models)�selfrrrrrrrr�>/usr/lib/python3.9/site-packages/yubico/yubikey_config_util.py�__init__szYubiKeyFlag.__init__cCs d|jjtt|��|j|jfS)Nz<%s instance at %s: %s (0x%x)>)�	__class__�__name__�hex�idrr�rrrr�__repr__4s
�zYubiKeyFlag.__repr__cCs
|j|kS)z0 Check if key is equal to that of this instance )r)rrrrr�is_equal<szYubiKeyFlag.is_equalcCs|jS)z Return flag value �rrrrr�
to_integer@szYubiKeyFlag.to_integercCs|jS)z% Return the minimum required version )rrrrr�req_versionDszYubiKeyFlag.req_versioncCs�||jvr|j}|jrF|jrFd||jd|jd|jd|jdfS|jrfd||jd|jdfSd||jd|jdfS)z9 Return string describing model and version requirement. z%s %d.%d..%d.%dr�z%s <= %d.%dz%s >= %d.%d)rrr)r�modelrrr�
req_stringHs
�zYubiKeyFlag.req_stringcCs6||jvrdS|jr(||jko&||jkS||jkSdS)zC Check if this flag is compatible with a YubiKey of version 'ver'. FN)rrr)rr"�versionrrr�
is_compatibleVs

�zYubiKeyFlag.is_compatible)r�
__module__�__qualname__�__doc__rrrrr r#r%rrrrrsrc@seZdZdZdS)rz7
    A ticket flag value, and associated metadata.
    N)rr&r'r(rrrrrasrcs"eZdZdZd�fdd�	Z�ZS)rz7
    A config flag value, and associated metadata.
    �Nrcs8t|�turdsJ�||_tt|�j|||||d�dS�Nr)rrr)r	r
�mode�superrr�rrrr+rrr�rrrrlszYubiKeyConfigFlag.__init__)r)NrN�rr&r'r(r�
__classcell__rrr.rrgsrcs"eZdZdZd�fdd�	Z�ZS)rz:
    An extended flag value, and associated metadata.
    r)N��r2cs8t|�turdsJ�||_tt|�j|||||d�dSr*)r	r
r+r,rrr-r.rrryszYubiKeyExtendedFlag.__init__)r)Nr1Nr/rrr.rrtsrc@sJeZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dS)rz5
    Class to hold bit values for configuration.
    rcCs
||_dS)Nr)r�defaultrrrr�szYubiKeyConfigBits.__init__cCsd|jjtt|��|jfS)Nz<%s instance at %s: value 0x%x>)rrrrrrrrrr�s

�zYubiKeyConfigBits.__repr__cCs4|�|�}|dur|�|�n|dur0|�|�|S)z�
        Return the boolean value of 'flag'. If 'new' is set,
        the flag is updated, and the value before update is
        returned.
        TF)�_is_set�_set�_clear)r�flag�new�oldrrr�get_set�s

zYubiKeyConfigBits.get_setcCs|jS)z, Return the sum of all flags as an integer. rrrrrr�szYubiKeyConfigBits.to_integercCs|j|@|kS)z. Check if flag is set. Returns True or False. r�rr7rrrr4�szYubiKeyConfigBits._is_setcCs|j|O_dS)z Set flag. Nrr;rrrr5�szYubiKeyConfigBits._setcCs|jd|M_dS)z
 Clear flag. �Nrr;rrrr6�szYubiKeyConfigBits._clearN)r)rr&r'r(rrr:rr4r5r6rrrrr�s

rN)r(�__all__�objectrrrrrrrrr�<module>sO