• Home
  • Raw
  • Download

Lines Matching refs:_ffi

18     ffi as _ffi,  unknown
125 data = _ffi.new("char[]", buffer)
132 _openssl_assert(bio != _ffi.NULL)
134 bio = _ffi.gc(bio, free)
142 result_buffer = _ffi.new("char**")
144 return _ffi.buffer(result_buffer[0], buffer_length)[:]
179 string_timestamp = _ffi.cast("ASN1_STRING*", timestamp)
185 return _ffi.string(_lib.ASN1_STRING_data(string_timestamp))
187 generalized_timestamp = _ffi.new("ASN1_GENERALIZEDTIME**")
189 if generalized_timestamp[0] == _ffi.NULL:
201 string_timestamp = _ffi.cast(
205 string_result = _ffi.string(string_data)
233 self._pkey = _ffi.gc(pkey, _lib.EVP_PKEY_free)
311 exponent = _ffi.gc(exponent, _lib.BN_free)
316 result = _lib.RSA_generate_key_ex(rsa, bits, exponent, _ffi.NULL)
324 _openssl_assert(dsa != _ffi.NULL)
326 dsa = _ffi.gc(dsa, _lib.DSA_free)
328 dsa, bits, _ffi.NULL, 0, _ffi.NULL, _ffi.NULL, _ffi.NULL
359 rsa = _ffi.gc(rsa, _lib.RSA_free)
417 num_curves = lib.EC_get_builtin_curves(_ffi.NULL, 0)
418 builtin_curves = _ffi.new("EC_builtin_curve[]", num_curves)
454 return cls(lib, nid, _ffi.string(lib.OBJ_nid2sn(nid)).decode("ascii"))
484 return _ffi.gc(key, _lib.EC_KEY_free)
553 self._name = _ffi.gc(name, _lib.X509_NAME_free)
621 result_buffer = _ffi.new("unsigned char**")
626 result = _ffi.buffer(result_buffer[0], data_length)[:].decode(
656 result_buffer = _ffi.new("char[]", 512)
660 _openssl_assert(format_result != _ffi.NULL)
663 _native(_ffi.string(result_buffer)),
685 result_buffer = _ffi.new("unsigned char**")
689 string_result = _ffi.buffer(result_buffer[0], encode_result)[:]
712 value = _ffi.buffer(
715 result.append((_ffi.string(name), value))
747 ctx = _ffi.new("X509V3_CTX*")
752 _lib.X509V3_set_ctx(ctx, _ffi.NULL, _ffi.NULL, _ffi.NULL, _ffi.NULL, 0)
781 extension = _lib.X509V3_EXT_nconf(_ffi.NULL, ctx, type_name, value)
782 if extension == _ffi.NULL:
784 self._extension = _ffi.gc(extension, _lib.X509_EXTENSION_free)
799 names = _ffi.cast(
803 names = _ffi.gc(names, _lib.GENERAL_NAMES_free)
815 _ffi.buffer(name.d.ia5.data, name.d.ia5.length)[:]
854 return _ffi.string(_lib.OBJ_nid2sn(nid))
866 string_result = _ffi.cast("ASN1_STRING*", octet_result)
869 return _ffi.buffer(char_result, result_length)[:]
879 self._req = _ffi.gc(req, _lib.X509_REQ_free)
938 _openssl_assert(pkey._pkey != _ffi.NULL)
939 pkey._pkey = _ffi.gc(pkey._pkey, _lib.EVP_PKEY_free)
978 _openssl_assert(name._name != _ffi.NULL)
995 _openssl_assert(stack != _ffi.NULL)
997 stack = _ffi.gc(stack, _lib.sk_X509_EXTENSION_free)
1020 native_exts_obj = _ffi.gc(
1024 _ffi.addressof(_lib._original_lib, "X509_EXTENSION_free"),
1033 ext._extension = _ffi.gc(extension, _lib.X509_EXTENSION_free)
1055 if digest_obj == _ffi.NULL:
1090 _openssl_assert(x509 != _ffi.NULL)
1091 self._x509 = _ffi.gc(x509, _lib.X509_free)
1099 cert._x509 = _ffi.gc(x509, _lib.X509_free)
1169 if pkey._pkey == _ffi.NULL:
1171 pkey._pkey = _ffi.gc(pkey._pkey, _lib.EVP_PKEY_free)
1212 if evp_md == _ffi.NULL:
1233 return _ffi.string(_lib.OBJ_nid2ln(nid))
1247 if digest == _ffi.NULL:
1250 result_buffer = _ffi.new("unsigned char[]", _lib.EVP_MAX_MD_SIZE)
1251 result_length = _ffi.new("unsigned int[]", 1)
1262 for ch in _ffi.buffer(result_buffer, result_length[0])
1291 bignum_serial = _ffi.new("BIGNUM**")
1298 if bignum_serial[0] == _ffi.NULL:
1306 asn1_serial = _lib.BN_to_ASN1_INTEGER(bignum_serial[0], _ffi.NULL)
1308 if asn1_serial == _ffi.NULL:
1311 asn1_serial = _ffi.gc(asn1_serial, _lib.ASN1_INTEGER_free)
1323 bignum_serial = _lib.ASN1_INTEGER_to_BN(asn1_serial, _ffi.NULL)
1327 hexstring_serial = _ffi.string(hex_serial)
1435 _openssl_assert(name._name != _ffi.NULL)
1548 if ext._extension == _ffi.NULL:
1552 ext._extension = _ffi.gc(extension, _lib.X509_EXTENSION_free)
1596 self._store = _ffi.gc(store, _lib.X509_STORE_free)
1677 param = _ffi.gc(param, _lib.X509_VERIFY_PARAM_free)
1716 cafile = _ffi.NULL
1721 capath = _ffi.NULL
1770 self._store_ctx = _ffi.gc(store_ctx, _lib.X509_STORE_CTX_free)
1790 return _ffi.NULL
1793 _openssl_assert(stack != _ffi.NULL)
1794 stack = _ffi.gc(stack, cleanup)
1840 _ffi.string(
1912 _openssl_assert(cert_stack != _ffi.NULL)
1917 _openssl_assert(cert != _ffi.NULL)
1944 x509 = _lib.PEM_read_bio_X509(bio, _ffi.NULL, _ffi.NULL, _ffi.NULL)
1946 x509 = _lib.d2i_X509_bio(bio, _ffi.NULL)
1950 if x509 == _ffi.NULL:
2037 if cipher_obj == _ffi.NULL:
2040 cipher_obj = _ffi.NULL
2048 _ffi.NULL,
2060 rsa = _ffi.gc(_lib.EVP_PKEY_get1_RSA(pkey._pkey), _lib.RSA_free)
2095 self._revoked = _ffi.gc(revoked, _lib.X509_REVOKED_free)
2108 bignum_serial = _ffi.gc(_lib.BN_new(), _lib.BN_free)
2109 bignum_ptr = _ffi.new("BIGNUM**")
2115 asn1_serial = _ffi.gc(
2116 _lib.BN_to_ASN1_INTEGER(bignum_serial, _ffi.NULL),
2134 _openssl_assert(asn1_int != _ffi.NULL)
2173 _openssl_assert(new_reason_ext != _ffi.NULL)
2174 new_reason_ext = _ffi.gc(new_reason_ext, _lib.ASN1_ENUMERATED_free)
2177 _openssl_assert(set_result != _ffi.NULL)
2253 self._crl = _ffi.gc(crl, _lib.X509_CRL_free)
2305 pyrev._revoked = _ffi.gc(revoked_copy, _lib.X509_REVOKED_free)
2322 _openssl_assert(copy != _ffi.NULL)
2336 _openssl_assert(_issuer != _ffi.NULL)
2337 _issuer = _ffi.gc(_issuer, _lib.X509_NAME_free)
2404 _openssl_assert(digest_obj != _ffi.NULL)
2439 if digest_obj == _ffi.NULL:
2443 _openssl_assert(bio != _ffi.NULL)
2448 _openssl_assert(sometime != _ffi.NULL)
2508 return _ffi.string(string_type)
2647 cacerts = _ffi.NULL
2650 cacerts = _ffi.gc(cacerts, _lib.sk_X509_free)
2655 passphrase = _ffi.NULL
2659 friendlyname = _ffi.NULL
2662 pkey = _ffi.NULL
2667 cert = _ffi.NULL
2683 if pkcs12 == _ffi.NULL:
2685 pkcs12 = _ffi.gc(pkcs12, _lib.PKCS12_free)
2699 self._spki = _ffi.gc(spki, _lib.NETSCAPE_SPKI_free)
2720 if digest_obj == _ffi.NULL:
2753 result = _ffi.string(encoded)
2766 _openssl_assert(pkey._pkey != _ffi.NULL)
2767 pkey._pkey = _ffi.gc(pkey._pkey, _lib.EVP_PKEY_free)
2796 return _ffi.NULL
2798 return _ffi.callback("pem_password_cb", self._read_passphrase)
2807 return _ffi.NULL
2809 return _ffi.NULL
2870 bio, _ffi.NULL, _ffi.NULL, _ffi.NULL
2873 evp_pkey = _lib.d2i_PUBKEY_bio(bio, _ffi.NULL)
2877 if evp_pkey == _ffi.NULL:
2881 pkey._pkey = _ffi.gc(evp_pkey, _lib.EVP_PKEY_free)
2907 bio, _ffi.NULL, helper.callback, helper.callback_args
2911 evp_pkey = _lib.d2i_PrivateKey_bio(bio, _ffi.NULL)
2915 if evp_pkey == _ffi.NULL:
2919 pkey._pkey = _ffi.gc(evp_pkey, _lib.EVP_PKEY_free)
2966 req = _lib.PEM_read_bio_X509_REQ(bio, _ffi.NULL, _ffi.NULL, _ffi.NULL)
2968 req = _lib.d2i_X509_REQ_bio(bio, _ffi.NULL)
2972 _openssl_assert(req != _ffi.NULL)
2975 x509req._req = _ffi.gc(req, _lib.X509_REQ_free)
2993 if digest_obj == _ffi.NULL:
2997 md_ctx = _ffi.gc(md_ctx, _lib.Cryptography_EVP_MD_CTX_free)
3004 signature_buffer = _ffi.new("unsigned char[]", length)
3005 signature_length = _ffi.new("unsigned int *")
3011 return _ffi.buffer(signature_buffer, signature_length[0])[:]
3030 if digest_obj == _ffi.NULL:
3034 _openssl_assert(pkey != _ffi.NULL)
3035 pkey = _ffi.gc(pkey, _lib.EVP_PKEY_free)
3038 md_ctx = _ffi.gc(md_ctx, _lib.Cryptography_EVP_MD_CTX_free)
3095 crl = _lib.PEM_read_bio_X509_CRL(bio, _ffi.NULL, _ffi.NULL, _ffi.NULL)
3097 crl = _lib.d2i_X509_CRL_bio(bio, _ffi.NULL)
3101 if crl == _ffi.NULL:
3105 result._crl = _ffi.gc(crl, _lib.X509_CRL_free)
3124 pkcs7 = _lib.PEM_read_bio_PKCS7(bio, _ffi.NULL, _ffi.NULL, _ffi.NULL)
3126 pkcs7 = _lib.d2i_PKCS7_bio(bio, _ffi.NULL)
3130 if pkcs7 == _ffi.NULL:
3134 pypkcs7._pkcs7 = _ffi.gc(pkcs7, _lib.PKCS7_free)
3173 passphrase = _ffi.NULL
3175 p12 = _lib.d2i_PKCS12_bio(bio, _ffi.NULL)
3176 if p12 == _ffi.NULL:
3178 p12 = _ffi.gc(p12, _lib.PKCS12_free)
3180 pkey = _ffi.new("EVP_PKEY**")
3181 cert = _ffi.new("X509**")
3182 cacerts = _ffi.new("Cryptography_STACK_OF_X509**")
3188 cacerts = _ffi.gc(cacerts[0], _lib.sk_X509_free)
3198 if pkey[0] == _ffi.NULL:
3202 pykey._pkey = _ffi.gc(pkey[0], _lib.EVP_PKEY_free)
3204 if cert[0] == _ffi.NULL:
3210 friendlyname_length = _ffi.new("int*")
3214 friendlyname = _ffi.buffer(
3217 if friendlyname_buffer == _ffi.NULL: