/usr/lib/python2.7/dist-packages/gnutls/constants.py is in python-gnutls 3.0.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | """GNUTLS constants"""
__all__ = [
## Credential types
'CRED_CERTIFICATE', 'CRED_ANON',
## X509 certificate/private key formats
'X509_FMT_DER', 'X509_FMT_PEM',
## Miscellaneous
'CERT_REQUEST', 'CERT_REQUIRE', 'SHUT_RDWR', 'SHUT_WR'
]
__name_map__ = {
'PROTO_TLS1_2': 'TLS1_2', 'PROTO_TLS1_1': 'TLS1_1', 'PROTO_TLS1_0': 'TLS1_0',
'PROTO_SSL3': 'SSL3', 'CRED_CERTIFICATE': 'CRD_CERTIFICATE', 'CRED_ANON': 'CRD_ANON'
}
from gnutls.library import constants
class GNUTLSConstant(int):
def __new__(cls, name):
gnutls_name = 'GNUTLS_' + __name_map__.get(name, name)
instance = int.__new__(cls, getattr(constants, gnutls_name))
instance.name = name
return instance
def __repr__(self):
return self.name
## Generate all exported constants
code = '\n'.join(["%s = GNUTLSConstant('%s')" % (name, name) for name in __all__])
exec code in locals(), globals()
del code, name
del constants
|