• Home
  • Raw
  • Download

Lines Matching refs:_ffi

17     ffi as _ffi,  unknown
122 data = _ffi.new("char[]", buffer)
129 _openssl_assert(bio != _ffi.NULL)
131 bio = _ffi.gc(bio, free)
139 result_buffer = _ffi.new('char**')
141 return _ffi.buffer(result_buffer[0], buffer_length)[:]
176 string_timestamp = _ffi.cast('ASN1_STRING*', timestamp)
182 return _ffi.string(_lib.ASN1_STRING_data(string_timestamp))
184 generalized_timestamp = _ffi.new("ASN1_GENERALIZEDTIME**")
186 if generalized_timestamp[0] == _ffi.NULL:
198 string_timestamp = _ffi.cast(
201 string_result = _ffi.string(string_data)
228 self._pkey = _ffi.gc(pkey, _lib.EVP_PKEY_free)
299 exponent = _ffi.gc(exponent, _lib.BN_free)
304 result = _lib.RSA_generate_key_ex(rsa, bits, exponent, _ffi.NULL)
312 _openssl_assert(dsa != _ffi.NULL)
314 dsa = _ffi.gc(dsa, _lib.DSA_free)
316 dsa, bits, _ffi.NULL, 0, _ffi.NULL, _ffi.NULL, _ffi.NULL
347 rsa = _ffi.gc(rsa, _lib.RSA_free)
411 num_curves = lib.EC_get_builtin_curves(_ffi.NULL, 0)
412 builtin_curves = _ffi.new('EC_builtin_curve[]', num_curves)
450 return cls(lib, nid, _ffi.string(lib.OBJ_nid2sn(nid)).decode("ascii"))
480 return _ffi.gc(key, _lib.EC_KEY_free)
549 self._name = _ffi.gc(name, _lib.X509_NAME_free)
614 result_buffer = _ffi.new("unsigned char**")
619 result = _ffi.buffer(
648 result_buffer = _ffi.new("char[]", 512)
651 _openssl_assert(format_result != _ffi.NULL)
654 _native(_ffi.string(result_buffer)),)
675 result_buffer = _ffi.new('unsigned char**')
679 string_result = _ffi.buffer(result_buffer[0], encode_result)[:]
702 value = _ffi.buffer(_lib.ASN1_STRING_data(fval),
704 result.append((_ffi.string(name), value))
743 ctx = _ffi.new("X509V3_CTX*")
748 _lib.X509V3_set_ctx(ctx, _ffi.NULL, _ffi.NULL, _ffi.NULL, _ffi.NULL, 0)
777 extension = _lib.X509V3_EXT_nconf(_ffi.NULL, ctx, type_name, value)
778 if extension == _ffi.NULL:
780 self._extension = _ffi.gc(extension, _lib.X509_EXTENSION_free)
795 names = _ffi.cast(
799 names = _ffi.gc(names, _lib.GENERAL_NAMES_free)
811 _ffi.buffer(name.d.ia5.data, name.d.ia5.length)[:])
849 return _ffi.string(_lib.OBJ_nid2sn(nid))
861 string_result = _ffi.cast('ASN1_STRING*', octet_result)
864 return _ffi.buffer(char_result, result_length)[:]
881 self._req = _ffi.gc(req, _lib.X509_REQ_free)
939 _openssl_assert(pkey._pkey != _ffi.NULL)
940 pkey._pkey = _ffi.gc(pkey._pkey, _lib.EVP_PKEY_free)
979 _openssl_assert(name._name != _ffi.NULL)
996 _openssl_assert(stack != _ffi.NULL)
998 stack = _ffi.gc(stack, _lib.sk_X509_EXTENSION_free)
1045 if digest_obj == _ffi.NULL:
1086 _openssl_assert(x509 != _ffi.NULL)
1087 self._x509 = _ffi.gc(x509, _lib.X509_free)
1095 cert._x509 = _ffi.gc(x509, _lib.X509_free)
1164 if pkey._pkey == _ffi.NULL:
1166 pkey._pkey = _ffi.gc(pkey._pkey, _lib.EVP_PKEY_free)
1207 if evp_md == _ffi.NULL:
1228 return _ffi.string(_lib.OBJ_nid2ln(nid))
1242 if digest == _ffi.NULL:
1245 result_buffer = _ffi.new("unsigned char[]", _lib.EVP_MAX_MD_SIZE)
1246 result_length = _ffi.new("unsigned int[]", 1)
1255 in _ffi.buffer(result_buffer, result_length[0])])
1282 bignum_serial = _ffi.new("BIGNUM**")
1289 if bignum_serial[0] == _ffi.NULL:
1296 asn1_serial = _lib.BN_to_ASN1_INTEGER(bignum_serial[0], _ffi.NULL)
1298 if asn1_serial == _ffi.NULL:
1301 asn1_serial = _ffi.gc(asn1_serial, _lib.ASN1_INTEGER_free)
1313 bignum_serial = _lib.ASN1_INTEGER_to_BN(asn1_serial, _ffi.NULL)
1317 hexstring_serial = _ffi.string(hex_serial)
1425 _openssl_assert(name._name != _ffi.NULL)
1538 if ext._extension == _ffi.NULL:
1542 ext._extension = _ffi.gc(extension, _lib.X509_EXTENSION_free)
1592 self._store = _ffi.gc(store, _lib.X509_STORE_free)
1681 param = _ffi.gc(param, _lib.X509_VERIFY_PARAM_free)
1728 self._store_ctx = _ffi.gc(store_ctx, _lib.X509_STORE_CTX_free)
1744 self._store_ctx, self._store._store, self._cert._x509, _ffi.NULL
1768 _native(_ffi.string(_lib.X509_verify_cert_error_string(
1829 x509 = _lib.PEM_read_bio_X509(bio, _ffi.NULL, _ffi.NULL, _ffi.NULL)
1831 x509 = _lib.d2i_X509_bio(bio, _ffi.NULL)
1836 if x509 == _ffi.NULL:
1921 if cipher_obj == _ffi.NULL:
1924 cipher_obj = _ffi.NULL
1929 bio, pkey._pkey, cipher_obj, _ffi.NULL, 0,
1938 rsa = _ffi.gc(
1974 self._revoked = _ffi.gc(revoked, _lib.X509_REVOKED_free)
1987 bignum_serial = _ffi.gc(_lib.BN_new(), _lib.BN_free)
1988 bignum_ptr = _ffi.new("BIGNUM**")
1994 asn1_serial = _ffi.gc(
1995 _lib.BN_to_ASN1_INTEGER(bignum_serial, _ffi.NULL),
2012 _openssl_assert(asn1_int != _ffi.NULL)
2051 _openssl_assert(new_reason_ext != _ffi.NULL)
2052 new_reason_ext = _ffi.gc(new_reason_ext, _lib.ASN1_ENUMERATED_free)
2055 _openssl_assert(set_result != _ffi.NULL)
2130 self._crl = _ffi.gc(crl, _lib.X509_CRL_free)
2181 pyrev._revoked = _ffi.gc(revoked_copy, _lib.X509_REVOKED_free)
2198 _openssl_assert(copy != _ffi.NULL)
2212 _openssl_assert(_issuer != _ffi.NULL)
2213 _issuer = _ffi.gc(_issuer, _lib.X509_NAME_free)
2280 _openssl_assert(digest_obj != _ffi.NULL)
2313 if digest_obj == _ffi.NULL:
2317 _openssl_assert(bio != _ffi.NULL)
2322 _openssl_assert(sometime != _ffi.NULL)
2389 return _ffi.string(string_type)
2535 cacerts = _ffi.NULL
2538 cacerts = _ffi.gc(cacerts, _lib.sk_X509_free)
2543 passphrase = _ffi.NULL
2547 friendlyname = _ffi.NULL
2550 pkey = _ffi.NULL
2555 cert = _ffi.NULL
2564 if pkcs12 == _ffi.NULL:
2566 pkcs12 = _ffi.gc(pkcs12, _lib.PKCS12_free)
2587 self._spki = _ffi.gc(spki, _lib.NETSCAPE_SPKI_free)
2608 if digest_obj == _ffi.NULL:
2641 result = _ffi.string(encoded)
2654 _openssl_assert(pkey._pkey != _ffi.NULL)
2655 pkey._pkey = _ffi.gc(pkey._pkey, _lib.EVP_PKEY_free)
2691 return _ffi.NULL
2693 return _ffi.NULL
2695 return _ffi.callback("pem_password_cb", self._read_passphrase)
2704 return _ffi.NULL
2708 return _ffi.NULL
2766 bio, _ffi.NULL, _ffi.NULL, _ffi.NULL)
2768 evp_pkey = _lib.d2i_PUBKEY_bio(bio, _ffi.NULL)
2772 if evp_pkey == _ffi.NULL:
2776 pkey._pkey = _ffi.gc(evp_pkey, _lib.EVP_PKEY_free)
2802 bio, _ffi.NULL, helper.callback, helper.callback_args)
2805 evp_pkey = _lib.d2i_PrivateKey_bio(bio, _ffi.NULL)
2809 if evp_pkey == _ffi.NULL:
2813 pkey._pkey = _ffi.gc(evp_pkey, _lib.EVP_PKEY_free)
2860 req = _lib.PEM_read_bio_X509_REQ(bio, _ffi.NULL, _ffi.NULL, _ffi.NULL)
2862 req = _lib.d2i_X509_REQ_bio(bio, _ffi.NULL)
2866 _openssl_assert(req != _ffi.NULL)
2869 x509req._req = _ffi.gc(req, _lib.X509_REQ_free)
2887 if digest_obj == _ffi.NULL:
2891 md_ctx = _ffi.gc(md_ctx, _lib.Cryptography_EVP_MD_CTX_free)
2898 signature_buffer = _ffi.new("unsigned char[]", length)
2899 signature_length = _ffi.new("unsigned int *")
2904 return _ffi.buffer(signature_buffer, signature_length[0])[:]
2923 if digest_obj == _ffi.NULL:
2927 _openssl_assert(pkey != _ffi.NULL)
2928 pkey = _ffi.gc(pkey, _lib.EVP_PKEY_free)
2931 md_ctx = _ffi.gc(md_ctx, _lib.Cryptography_EVP_MD_CTX_free)
2987 crl = _lib.PEM_read_bio_X509_CRL(bio, _ffi.NULL, _ffi.NULL, _ffi.NULL)
2989 crl = _lib.d2i_X509_CRL_bio(bio, _ffi.NULL)
2993 if crl == _ffi.NULL:
2997 result._crl = _ffi.gc(crl, _lib.X509_CRL_free)
3016 pkcs7 = _lib.PEM_read_bio_PKCS7(bio, _ffi.NULL, _ffi.NULL, _ffi.NULL)
3018 pkcs7 = _lib.d2i_PKCS7_bio(bio, _ffi.NULL)
3022 if pkcs7 == _ffi.NULL:
3026 pypkcs7._pkcs7 = _ffi.gc(pkcs7, _lib.PKCS7_free)
3054 passphrase = _ffi.NULL
3056 p12 = _lib.d2i_PKCS12_bio(bio, _ffi.NULL)
3057 if p12 == _ffi.NULL:
3059 p12 = _ffi.gc(p12, _lib.PKCS12_free)
3061 pkey = _ffi.new("EVP_PKEY**")
3062 cert = _ffi.new("X509**")
3063 cacerts = _ffi.new("Cryptography_STACK_OF_X509**")
3069 cacerts = _ffi.gc(cacerts[0], _lib.sk_X509_free)
3079 if pkey[0] == _ffi.NULL:
3083 pykey._pkey = _ffi.gc(pkey[0], _lib.EVP_PKEY_free)
3085 if cert[0] == _ffi.NULL:
3091 friendlyname_length = _ffi.new("int*")
3095 friendlyname = _ffi.buffer(
3098 if friendlyname_buffer == _ffi.NULL: