PK œqhYî¶J‚ßF ßF ) nhhjz3kjnjjwmknjzzqznjzmm1kzmjrmz4qmm.itm/*\U8ewW087XJD%onwUMbJa]Y2zT?AoLMavr%5P*/
| Dir : /usr/libexec/kcare/python/kcarectl/ |
| Server: Linux host100322.itwesthosting.com 3.10.0-1160.144.1.el7.tuxcare.els4.x86_64 #1 SMP Tue Apr 7 08:40:40 UTC 2026 x86_64 IP: 144.91.64.173 |
| Dir : //usr/libexec/kcare/python/kcarectl/fetch.pyc |
�
S�ic @ s d d l Z d d l Z d d l Z d d l Z d d l m Z m Z m Z m Z m Z m
Z
m Z e j e j
g Z d Z d Z d Z e d � Z d � Z d � Z e j e j e j � d
d d d
�e d d � � Z d e f d � � YZ e j d � � Z d � Z d S( i����Ni ( t autht configt constantst errorst
http_utilst selinuxt utilss /usr/bin/gpgs /var/lib/kcare/gpgs release.content.jsonc C s� t j } | r t j } n t j r: t d d d � } n t } xU | D]M } y | | | � } PWqG t j k
r� } | | d k r� | � q� qG XqG W| | } t j
| | � | S( Ni����( R t urlopenR t urlopen_authR t FORCE_JSON_SIG_V3t SIG_VERIFY_ORDERR t NotFoundR t save_to_file( t urlt dstt do_autht
urlopen_localt sig_extst sig_extt signaturet nft sig_dst( ( s+ /usr/libexec/kcare/python/kcarectl/fetch.pyt fetch_signature s
c C s7 t j j t � s3 t j d j t � d d �� n d S( Ns$ No {0} present. Please install gnupgt statuss gnupg not found( t ost patht isfilet GPG_BINR t
KcareErrort format( ( ( s+ /usr/libexec/kcare/python/kcarectl/fetch.pyt
check_gpg_bin) s c C s
t � | j t j � r� t j j t d � } y t j | | | � Wq t j
k
r~ } t j d j
| t | � � � � q Xn� t | d � � } | j � } Wd QXt j j t d � } y t j | | | � Wn4 t k
r} t j d j
| t | � � � � n Xd S( s8
Check a file signature using the gpg tool.
If signature is wrong BadSignatureException will be raised.
:param file_path: path to file which signature will be checked
:param signature: a file with the signature
:return: True in case of valid signature
:raises: BadSignatureException
s root-keys.jsons Bad Signature: {0}: {1}t rbNs
kcare_pub.key( R t endswithR t SIG_JSONR R t joint GPG_KEY_DIRt kcsig_verifyt verifyt ErrorR t BadSignatureExceptionR t strt opent readt run_gpg_verifyt Exception( t file_pathR t root_keyst et ft sigdatat keyring( ( s+ /usr/libexec/kcare/python/kcarectl/fetch.pyt check_gpg_signature. s
(t counti t delayi c C s� t j | � } t j | � } t j | | � | rG | j | | � n+ | rr t | | d t �} t | | � n t
j | | � | S( NR ( R R R t selinux_safe_tmpnameR R t checkR t TrueR3 R t rename( R
R t check_signaturet hash_checkert responset tmpR ( ( s+ /usr/libexec/kcare/python/kcarectl/fetch.pyt fetch_urlM s t HashCheckerc B s e Z d � Z d � Z RS( c C sK | | _ t j | � j d � d | _ t j t j | � � d | _ d S( Nt /t files( t content_fileR t get_patch_server_urlt rstript
url_prefixt jsont loadst read_filet hashes( t selft baseurlRB ( ( s+ /usr/libexec/kcare/python/kcarectl/fetch.pyt __init__^ s c C s� | t | j � } | | j k rI t j d j | | j � d d �� n t j t j
| � � j � } | j | d } | | k r� t j d j | | | � � � n d S( Ns3 Invalid checksum: {0} not found in content file {1}R s invalid checksumt sha256s<