Botan 2.19.3
Crypto and TLS for C&
|
Classes | |
struct | botan_struct |
class | FFI_Error |
Functions | |
template<typename T , uint32_t M, typename F > | |
int | apply_fn (botan_struct< T, M > *o, const char *func_name, F func) |
template<typename T , uint32_t M> | |
int | ffi_delete_object (botan_struct< T, M > *obj, const char *func_name) |
int | ffi_error_exception_thrown (const char *func_name, const char *exn, int rc) |
int | ffi_guard_thunk (const char *func_name, std::function< int()> thunk) |
template<typename T , uint32_t M> | |
T & | safe_get (botan_struct< T, M > *p) |
int | write_output (uint8_t out[], size_t *out_len, const uint8_t buf[], size_t buf_len) |
int | write_str_output (char out[], size_t *out_len, const std::string &str) |
int | write_str_output (char out[], size_t *out_len, const std::vector< uint8_t > &str_vec) |
int | write_str_output (uint8_t out[], size_t *out_len, const std::string &str) |
template<typename Alloc > | |
int | write_vec_output (uint8_t out[], size_t *out_len, const std::vector< uint8_t, Alloc > &buf) |
int Botan_FFI::apply_fn | ( | botan_struct< T, M > * | o, |
const char * | func_name, | ||
F | func | ||
) |
Definition at line 77 of file ffi_util.h.
References BOTAN_FFI_ERROR_INVALID_OBJECT, BOTAN_FFI_ERROR_NULL_POINTER, ffi_guard_thunk(), Botan_FFI::botan_struct< T, MAGIC >::magic_ok(), T, and Botan_FFI::botan_struct< T, MAGIC >::unsafe_get().
int Botan_FFI::ffi_delete_object | ( | botan_struct< T, M > * | obj, |
const char * | func_name | ||
) |
Definition at line 106 of file ffi_util.h.
References BOTAN_FFI_ERROR_INVALID_OBJECT, BOTAN_FFI_SUCCESS, ffi_error_exception_thrown(), and Botan_FFI::botan_struct< T, MAGIC >::magic_ok().
int Botan_FFI::ffi_error_exception_thrown | ( | const char * | func_name, |
const char * | exn, | ||
int | rc | ||
) |
Definition at line 19 of file ffi.cpp.
References Botan::OS::read_env_variable().
Referenced by ffi_delete_object(), and ffi_guard_thunk().
int Botan_FFI::ffi_guard_thunk | ( | const char * | func_name, |
std::function< int()> | thunk | ||
) |
Definition at line 89 of file ffi.cpp.
References BOTAN_FFI_ERROR_OUT_OF_MEMORY, BOTAN_FFI_ERROR_UNKNOWN_ERROR, Botan_FFI::FFI_Error::error_code(), Botan_FFI::FFI_Error::error_type(), ffi_error_exception_thrown(), and Botan::Exception::what().
Referenced by apply_fn(), botan_base64_decode(), botan_base64_encode(), botan_bcrypt_generate(), botan_bcrypt_is_valid(), botan_block_cipher_init(), botan_cipher_init(), botan_cipher_start(), botan_cipher_update(), botan_fpe_decrypt(), botan_fpe_encrypt(), botan_fpe_fe1_init(), botan_hash_init(), botan_hex_decode(), botan_hex_encode(), botan_hotp_init(), botan_kdf(), botan_key_unwrap3394(), botan_key_wrap3394(), botan_mac_init(), botan_mceies_decrypt(), botan_mceies_encrypt(), botan_mp_init(), botan_pk_op_decrypt_create(), botan_pk_op_encrypt_create(), botan_pk_op_key_agreement_create(), botan_pk_op_sign_create(), botan_pk_op_verify_create(), botan_pkcs_hash_id(), botan_privkey_create(), botan_privkey_create_dsa(), botan_privkey_create_elgamal(), botan_privkey_export_pubkey(), botan_privkey_load(), botan_privkey_load_dh(), botan_privkey_load_dsa(), botan_privkey_load_ecdh(), botan_privkey_load_ecdsa(), botan_privkey_load_ed25519(), botan_privkey_load_elgamal(), botan_privkey_load_rsa(), botan_privkey_load_rsa_pkcs1(), botan_privkey_load_sm2(), botan_privkey_load_x25519(), botan_pubkey_load(), botan_pubkey_load_dh(), botan_pubkey_load_dsa(), botan_pubkey_load_ecdh(), botan_pubkey_load_ecdsa(), botan_pubkey_load_ed25519(), botan_pubkey_load_elgamal(), botan_pubkey_load_rsa(), botan_pubkey_load_sm2(), botan_pubkey_load_x25519(), botan_pubkey_sm2_compute_za(), botan_pwdhash(), botan_pwdhash_timed(), botan_rng_init(), botan_rng_init_custom(), botan_totp_init(), botan_x509_cert_dup(), botan_x509_cert_get_public_key(), botan_x509_cert_load(), botan_x509_cert_load_file(), botan_x509_cert_verify(), botan_x509_cert_verify_with_crl(), botan_x509_crl_load(), and botan_x509_crl_load_file().
T & Botan_FFI::safe_get | ( | botan_struct< T, M > * | p | ) |
Definition at line 61 of file ffi_util.h.
References BOTAN_FFI_ERROR_INVALID_OBJECT, BOTAN_FFI_ERROR_NULL_POINTER, Botan_FFI::botan_struct< T, MAGIC >::magic_ok(), T, and Botan_FFI::botan_struct< T, MAGIC >::unsafe_get().
Referenced by botan_bcrypt_generate(), botan_cipher_start(), botan_cipher_update(), botan_fpe_decrypt(), botan_fpe_encrypt(), botan_fpe_fe1_init(), botan_mceies_decrypt(), botan_mceies_encrypt(), botan_mp_add(), botan_mp_add_u32(), botan_mp_cmp(), botan_mp_div(), botan_mp_equal(), botan_mp_gcd(), botan_mp_is_prime(), botan_mp_lshift(), botan_mp_mod_inverse(), botan_mp_mod_mul(), botan_mp_mul(), botan_mp_powmod(), botan_mp_rand_bits(), botan_mp_rand_range(), botan_mp_rshift(), botan_mp_set_from_mp(), botan_mp_sub(), botan_mp_sub_u32(), botan_mp_swap(), botan_pk_op_decrypt_create(), botan_pk_op_encrypt(), botan_pk_op_encrypt_create(), botan_pk_op_key_agreement_create(), botan_pk_op_sign_create(), botan_pk_op_sign_finish(), botan_pk_op_verify_create(), botan_privkey_check_key(), botan_privkey_create(), botan_privkey_create_dsa(), botan_privkey_create_elgamal(), botan_privkey_export_encrypted_pbkdf_iter(), botan_privkey_export_encrypted_pbkdf_msec(), botan_privkey_export_pubkey(), botan_privkey_get_field(), botan_privkey_load_dh(), botan_privkey_load_dsa(), botan_privkey_load_ecdh(), botan_privkey_load_ecdsa(), botan_privkey_load_elgamal(), botan_privkey_load_rsa(), botan_privkey_load_sm2(), botan_pubkey_check_key(), botan_pubkey_get_field(), botan_pubkey_load_dh(), botan_pubkey_load_dsa(), botan_pubkey_load_ecdh(), botan_pubkey_load_ecdsa(), botan_pubkey_load_elgamal(), botan_pubkey_load_rsa(), botan_pubkey_load_sm2(), botan_pubkey_sm2_compute_za(), botan_rng_reseed_from_rng(), botan_x509_cert_dup(), botan_x509_cert_get_public_key(), botan_x509_cert_verify(), botan_x509_cert_verify_with_crl(), and botan_x509_is_revoked().
|
inline |
Definition at line 131 of file ffi_util.h.
References BOTAN_FFI_ERROR_INSUFFICIENT_BUFFER_SPACE, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, Botan::clear_mem(), and Botan::copy_mem().
Referenced by botan_pkcs_hash_id(), write_str_output(), write_str_output(), and write_vec_output().
|
inline |
Definition at line 167 of file ffi_util.h.
References Botan::cast_char_ptr_to_uint8(), and write_str_output().
|
inline |
Definition at line 172 of file ffi_util.h.
References Botan::cast_char_ptr_to_uint8(), and write_output().
|
inline |
Definition at line 160 of file ffi_util.h.
References Botan::cast_char_ptr_to_uint8(), and write_output().
Referenced by botan_base64_encode(), botan_bcrypt_generate(), botan_block_cipher_name(), botan_cipher_name(), botan_hash_name(), botan_mac_name(), botan_mp_to_str(), botan_privkey_algo_name(), botan_privkey_export(), botan_privkey_export_encrypted_pbkdf_iter(), botan_privkey_export_encrypted_pbkdf_msec(), botan_privkey_rsa_get_privkey(), botan_pubkey_algo_name(), botan_pubkey_export(), botan_x509_cert_get_fingerprint(), botan_x509_cert_get_issuer_dn(), botan_x509_cert_get_subject_dn(), botan_x509_cert_get_time_expires(), botan_x509_cert_get_time_starts(), botan_x509_cert_to_string(), and write_str_output().
int Botan_FFI::write_vec_output | ( | uint8_t | out[], |
size_t * | out_len, | ||
const std::vector< uint8_t, Alloc > & | buf | ||
) |
Definition at line 155 of file ffi_util.h.
References write_output().
Referenced by botan_hex_decode(), botan_key_unwrap3394(), botan_key_wrap3394(), botan_mceies_decrypt(), botan_mceies_encrypt(), botan_pk_op_decrypt(), botan_pk_op_encrypt(), botan_pk_op_key_agreement(), botan_pk_op_key_agreement_export_public(), botan_pk_op_sign_finish(), botan_privkey_export(), botan_privkey_export_encrypted_pbkdf_iter(), botan_privkey_export_encrypted_pbkdf_msec(), botan_privkey_rsa_get_privkey(), botan_pubkey_export(), botan_pubkey_fingerprint(), botan_pubkey_sm2_compute_za(), botan_x509_cert_get_authority_key_id(), botan_x509_cert_get_public_key_bits(), botan_x509_cert_get_serial_number(), and botan_x509_cert_get_subject_key_id().