HEX
Server: LiteSpeed
System: Linux s1049.use1.mysecurecloudhost.com 4.18.0-477.27.2.lve.el8.x86_64 #1 SMP Wed Oct 11 12:32:56 UTC 2023 x86_64
User: xedaptot (3356)
PHP: 8.3.31
Disabled: NONE
Upload Files
File: //lib/python3.6/site-packages/yubico/__pycache__/yubikey_config_util.cpython-36.pyc
3

y@�V��@sddZddddgZGdd�de�ZGdd�de�ZGdd�de�ZGd	d�de�ZGd
d�de�ZdS)z+
utility functions used in yubikey_config.
�YubiKeyConfigBits�YubiKeyConfigFlag�YubiKeyExtendedFlag�YubiKeyTicketFlagc@sXeZdZdZddddddgfdd�Zd	d
�Zdd�Zd
d�Zdd�Zdd�Z	dd�Z
dS)�YubiKeyFlagz0
    A flag value, and associated metadata.
    N�ZYubiKeyzYubiKey NEOz	YubiKey 4cCsxt|�tk	rfst�t|�tk	r(fs(t�t|�tk	r<fs<t�t|�tk	rPfsPt�||_||_||_||_	||_
||_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�AssertionError�int�tuple�list�key�value�doc�	min_ykver�	max_ykver�models)�selfr
rrrrr�r�)/usr/lib/python3.6/yubikey_config_util.py�__init__szYubiKeyFlag.__init__cCs d|jjtt|��|j|jfS)Nz<%s instance at %s: %s (0x%x)>)�	__class__�__name__�hex�idr
r)rrrr�__repr__4s

zYubiKeyFlag.__repr__cCs
|j|kS)z0 Check if key is equal to that of this instance )r
)rr
rrr�is_equal<szYubiKeyFlag.is_equalcCs|jS)z Return flag value )r)rrrr�
to_integer@szYubiKeyFlag.to_integercCs|jS)z% Return the minimum required version )r)rrrr�req_versionDszYubiKeyFlag.req_versioncCs�||jkr|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||jkrdS|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)rr)r�
__module__�__qualname__�__doc__rrrrrr!r#rrrrrsrc@seZdZdZdS)rz7
    A ticket flag value, and associated metadata.
    N)rr$r%r&rrrrrascs"eZdZdZd�fdd�	Z�ZS)	rz7
    A config flag value, and associated metadata.
    �Nrcs8t|�tk	rfst�||_tt|�j|||||d�dS)N)rrr)rrr	�mode�superrr)rr
rr(rrr)rrrrlszYubiKeyConfigFlag.__init__�rr)r'Nr*N)rr$r%r&r�
__classcell__rr)rrrgscs"eZdZdZd�fdd�	Z�ZS)	rz:
    An extended flag value, and associated metadata.
    r'N�cs8t|�tk	rfst�||_tt|�j|||||d�dS)N)rrr)rrr	r(r)rr)rr
rr(rrr)rrrryszYubiKeyExtendedFlag.__init__�r,r,)r'Nr-N)rr$r%r&rr+rr)rrrtsc@sJeZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dS)rz5
    Class to hold bit values for configuration.
    rcCs
||_dS)N)r)r�defaultrrrr�szYubiKeyConfigBits.__init__cCsd|jjtt|��|jfS)Nz<%s instance at %s: value 0x%x>)rrrrr)rrrrr�s
zYubiKeyConfigBits.__repr__cCs4|j|�}|dkr|j|�n|dkr0|j|�|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. )r)rrrrr�szYubiKeyConfigBits.to_integercCs|j|@|kS)z. Check if flag is set. Returns True or False. )r)rr2rrrr/�szYubiKeyConfigBits._is_setcCs|j|O_dS)z Set flag. N)r)rr2rrrr0�szYubiKeyConfigBits._setcCs|jd|M_dS)z
 Clear flag. �N)r)rr2rrrr1�szYubiKeyConfigBits._clearN)r)rr$r%r&rrr5rr/r0r1rrrrr�s

N)r&�__all__�objectrrrrrrrrr�<module>sO