PNG  IHDR;IDATxܻn0K )(pA 7LeG{ §㻢|ذaÆ 6lذaÆ 6lذaÆ 6lom$^yذag5bÆ 6lذaÆ 6lذa{ 6lذaÆ `}HFkm,mӪôô! x|'ܢ˟;E:9&ᶒ}{v]n&6 h_tڠ͵-ҫZ;Z$.Pkž)!o>}leQfJTu іچ\X=8Rن4`Vwl>nG^is"ms$ui?wbs[m6K4O.4%/bC%t Mז -lG6mrz2s%9s@-k9=)kB5\+͂Zsٲ Rn~GRC wIcIn7jJhۛNCS|j08yiHKֶۛkɈ+;SzL/F*\Ԕ#"5m2[S=gnaPeғL lذaÆ 6l^ḵaÆ 6lذaÆ 6lذa; _ذaÆ 6lذaÆ 6lذaÆ RIENDB`  Uc@s]dZdddddgZddlmZddlZddlZddlZddlZddlZddl Z ddl Z dd l m Z m Z m Z mZddlZed d d d d fddeddd d d fddeddd d d fddeddd d d fddeddd d d fddeddd d d fddedd d dd fdd!ed"d d ddfdd#ed$d%d dd fdd&g Ze d'd d d d fdd(e d)dd d d fdd*d+d d,fe d-dd d d fdd.e d/dd d d fdd0e d1dd d d fdd2e d3dd dd fdd4e d5dd dd fdd6e d7d d dd fdd8e d9d%d dd fdd:e d;dd dd fd<d=dd>e d?dd dd fd<d=dd@e dAd d dd fd<d=ddBe dCdDd dd fd<d=ddEe dFdDd dd fd<d=ddGe dHdd ddfd<dIddJe dKdLd ddfd<dIddMe dNdd ddfd<dIddOe dPdd ddfd<dIddQgZe dRd d ddfddSe dTdd ddfddUe dVdd ddfddWe dXdd ddYfddZe d[dd ddYfdd\e d]dd ddYfdd^e d_d d ddYfdd`gZd ZdYZdZdaZdbZdcZde jfddYZdfdeYZdfZdS(gs! module for configuring YubiKeys t TicketFlagst ConfigFlagst ExtendedFlagstYubiKeyConfigErrort YubiKeyConfigi(t __version__N(tYubiKeyConfigBitstYubiKeyConfigFlagtYubiKeyExtendedFlagtYubiKeyTicketFlagt TAB_FIRSTit min_ykveritdocsSend TAB before first partt APPEND_TAB1isSend TAB after first partt APPEND_TAB2isSend TAB after second partt APPEND_DELAY1isAdd 0.5s delay after first partt APPEND_DELAY2is Add 0.5s delay after second partt APPEND_CRi sAppend CR as final charactert OATH_HOTPi@sChoose OATH-HOTP modet CHAL_RESPsChoose Challenge-Response modet PROTECT_CFG2isProtect configuration in slot 2tSEND_REFs(Send reference string (0..F) before datat TICKET_FIRSTs)Send ticket first (default is fixed part)t max_ykveri t PACING_10MSsAdd 10ms intra-key pacingt PACING_20MSsAdd 20ms intra-key pacingt STATIC_TICKETsStatic ticket generationt SHORT_TICKETs#Send truncated ticket (half length)t STRONG_PW1s+Strong password policy flag #1 (mixed case)t STRONG_PW2s9Strong password policy flag #2 (subtitute 0..7 to digits)t MAN_UPDATEs)Allow manual (local) update of static OTPt OATH_HOTP8tmodetOATHs+Generate 8 digits HOTP rather than 6 digitstOATH_FIXED_MODHEX1s'First byte in fixed part sent as modhextOATH_FIXED_MODHEX2s,First two bytes in fixed part sent as modhextOATH_FIXED_MODHEXiPsFixed part sent as modhextOATH_FIXED_MASKsMask to get out fixed flagst CHAL_YUBICOtCHALs,Challenge-response enabled - Yubico OTP modet CHAL_HMACi"s&Challenge-response enabled - HMAC-SHA1t HMAC_LT64s+Set when HMAC message is less than 64 bytest CHAL_BTN_TRIGs3Challenge-respoonse operation requires button presstSERIAL_BTN_VISIBLEs/Serial number visible at startup (button press)tSERIAL_USB_VISIBLEs*Serial number visible in USB iSerial fieldtSERIAL_API_VISIBLEs"Serial number visible via API calltUSE_NUMERIC_KEYPADisUse numeric keypad for digitst FAST_TRIGsUse fast trig if only cfg1 sett ALLOW_UPDATEsEAllow update of existing configuration (selected flags + access code)tDORMANTsODormant configuration (can be woken up and flag removed = requires update flag)iicCsEidd6dd6dd6dd6d d 6}||kr=||Sd |S( s Turn command number into name t SLOT_CONFIGit SLOT_CONFIG2it SLOT_UPDATE1it SLOT_UPDATE2it SLOT_SWAPis0x%02x((tnumtknown((s9/usr/lib/python2.7/site-packages/yubico/yubikey_config.pyt command2strXs   cBseZdZRS(s< Exception raised for YubiKey configuration errors. (t__name__t __module__t__doc__(((s9/usr/lib/python2.7/site-packages/yubico/yubikey_config.pyRdscBseZdZddeedZdZdZddZdZ dZ dZ dZ d Z d Zd dd d d dZdeedZddZddZddZdZddZd dZdZdZdZRS(sH Base class for configuration of all current types of YubiKeys. cCs|dkr$tjdt|_n ||_d |_||_d|_d|_d|_ d|_ t d|_ t d|_ t d|_d|_d|_|s|r|jddddn||_||_dS( sQ `ykver' is a tuple (major, minor) with the version number of the key you are planning to apply this configuration to. Not mandated, but will get you an exception when trying to set flags for example, rather than the YubiKey just not operating as expected after programming. YubiKey >= 2.3 supports updating certain parts of a configuration (for example turning on/off APPEND_CR) without overwriting others (most notably the stored secret). Set `update' to True if this is what you want. The current programming must have flag 'ALLOW_UPDATE' set to allow configuration update instead of requiring complete reprogramming. YubiKey >= 2.3 also supports swapping the configurations, making slot 1 be slot 2 and vice versa. Set swap=True for this. tdefault_answerittmajoritminoriN(ii(tNonetyubikeytYubiKeyCapabilitiestTruet capabilitiestyk_req_versiontykvertfixedtuidtkeyt access_codeRt ticket_flagst config_flagstextended_flagst unlock_codet_modet_require_versiont_update_configt _swap_slots(tselfRGREtupdatetswap((s9/usr/lib/python2.7/site-packages/yubico/yubikey_config.pyt__init__ms&             cCsd|jjtt||j|j|jt|jt|j t|j t|j |j j |jj |jj t|j|j|jfS(Nsl<%s instance at %s: mode %s, v=%s/%s, lf=%i, lu=%i, lk=%i, lac=%i, tf=%x, cf=%x, ef=%x, lu=%i, up=%s, sw=%s>(t __class__R:thextidRPRFRGtlenRHRIRJRKRLt to_integerRMRNRORRRS(RT((s9/usr/lib/python2.7/site-packages/yubico/yubikey_config.pyt__repr__s          cCs|jS(s` Return the (major, minor) versions of YubiKey required for this configuration. (RF(RT((s9/usr/lib/python2.7/site-packages/yubico/yubikey_config.pytversion_requiredscCsX|j}|dkrT|j|}t|dkrB||_qTtjdn|S(sC The fixed string is used to identify a particular Yubikey device. The fixed string is referred to as the 'Token Identifier' in OATH-HOTP mode. The length of the fixed string can be set between 0 and 16 bytes. Tip: This can also be used to extend the length of a static password. is&The "fixed" string must be 0..16 bytesN(RHRAt_decode_input_stringR[tyubico_exceptiont InputError(RTtdatatoldtnew((s9/usr/lib/python2.7/site-packages/yubico/yubikey_config.pyt fixed_strings   cCsI|jjsn|jdd|jdt|jdtdS(s Extended scan code mode means the Yubikey will output the bytes in the 'fixed string' as scan codes, without modhex encoding the data. Because of the way this is stored in the config flags, it is not possible to disable this option once it is enabled (of course, you can abort config update or reprogram the YubiKey again). Requires YubiKey 2.x. R?iRRN(REthave_extended_scan_code_modeRQt config_flagRDtFalse(RT((s9/usr/lib/python2.7/site-packages/yubico/yubikey_config.pytenable_extended_scan_code_modes cCs4|jdd|jdt|jdtdS(s This will cause a shifted character 1 (typically '!') to be sent before anything else. This can be used to make the YubiKey output qualify as a password with 'special characters', if such is required. Because of the way this is stored in the config flags, it is not possible to disable this option once it is enabled (of course, you can abort config update or reprogram the YubiKey again). Requires YubiKey 2.x. R?iRRN(RQRgRD(RT((s9/usr/lib/python2.7/site-packages/yubico/yubikey_config.pytenable_shifted_1s cCsR|j}|rN|j|}t|dkr<||_qNtjdn|S(s AES128 key to program into YubiKey. Supply data as either a raw string, or a hexlified string prefixed by 'h:'. The result, after any hex decoding, must be 16 bytes. is#AES128 key must be exactly 16 bytes(RJR_R[R`Ra(RTRbRcRd((s9/usr/lib/python2.7/site-packages/yubico/yubikey_config.pytaes_keys  cCsq|jdr%tj|d}n|}t|dkr^||_|jsm||_qmntjddS(s Access code to allow re-programming of your YubiKey. Supply data as either a raw string, or a hexlified string prefixed by 'h:'. The result, after any hex decoding, must be 6 bytes. sh:iis"Unlock key must be exactly 6 bytesN(t startswithtbinasciit unhexlifyR[RORKR`Ra(RTRbRd((s9/usr/lib/python2.7/site-packages/yubico/yubikey_config.pyt unlock_keys  cCs\|jdr%tj|d}n|}t|dkrI||_ntjddS(s Set a new access code which will be required for future re-programmings of your YubiKey. Supply data as either a raw string, or a hexlified string prefixed by 'h:'. The result, after any hex decoding, must be 6 bytes. sh:iis"Access key must be exactly 6 bytesN(RlRmRnR[RKR`Ra(RTRbRd((s9/usr/lib/python2.7/site-packages/yubico/yubikey_config.pyt access_key s  cCs|jjsBtjd|jj|jd|jdfn|jdrgtj|d}nt |t j krt j dt j n|jdddd d ||_|j|d S( sA Set the YubiKey up for standard OTP validation. s,Yubico OTP not available in %s version %d.%diish:isPrivate UID must be %i bytest YUBIKEY_OTPR?R@i N(REthave_yubico_OTPRBtYubiKeyVersionErrortmodelRGRlRmRnR[t yubikey_defstUID_SIZER`Rat _change_modeRIRk(RTt private_uidRk((s9/usr/lib/python2.7/site-packages/yubico/yubikey_config.pytmode_yubikey_otps * iiR>c Cs(|jjdsEtjd|jj|jd|jdfn|dkro|dkrotjdn|jdd d d d|j ||dkr|j d t n|s|s|r|j |}t |t ||}|j|n|r$|jtjd ||_ndS(s\ Set the YubiKey up for OATH-HOTP operation. Requires YubiKey 2.1. tHOTPs+OATH HOTP not available in %s version %d.%diiiisOATH-HOTP digits must be 6 or 8RR?iR@RsdSt|dkrX|dSdS(s Find 'which' entry in 'flags'. iiN(tis_equalR[RA(Rtflagstthistres((s9/usr/lib/python2.7/site-packages/yubico/yubikey_config.pyRs ((R<t__all__tyubicoRR~RmRRuRR`tyubikey_config_utilRRRR RBRRRR2R3R4R5R6R9t YubicoErrorRRR(((s9/usr/lib/python2.7/site-packages/yubico/yubikey_config.pytsv        " $*$$$$$$$$*$