import re


def validate_oid(oid):
    """
    make sure an oid contains only hex values 0-9 a-f A-F and is 40 characters
    return True if the oid is valid
    """
    find_illegal = re.search('[^0-9a-fA-F]+', oid)
    if find_illegal:
        return False
    else:
        if len(oid) >= 40 and len(oid) <= 128:
            return True
        else:
            return False