c2991d1 framework: Fix translation of hex values in AVCs

Authored and Committed by vmojzis 5 years ago
    framework: Fix translation of hex values in AVCs
    
    Audit encloses plain text values of path, name or exe fields in double
    quotes to distinguish them from hex encoded values. Use this instead of
    trying to hex-translate all values. The translation is done immediately
    after parsing the AVC, hence all other attempts to hex translate could
    be removed.
    
    Use bytearray.fromhex(path).decode('utf-8') in python 3
    (str.decode('hex') is invalid).
    Keep using str.decode('hex') on python 2 to avoid issues with unicode
    strings (which are not accepted by libselinux functions).
    
    Fixes:
       https://bugzilla.redhat.com/show_bug.cgi?id=1477236
    
    Signed-off-by: Vit Mojzis <vmojzis@redhat.com>