aboutsummaryrefslogtreecommitdiffstats
path: root/src/engine.h
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2025-02-26 12:09:05 +0000
committerWerner Koch <[email protected]>2025-02-26 13:11:20 +0000
commit0a64c7d0c6d0463cf2e06b3a01ef5be4d879bcf0 (patch)
tree56a7aa2ce0456a127edc3b85f812dbf487357d99 /src/engine.h
parentRemove now unused functions. (diff)
downloadgpgme-0a64c7d0c6d0463cf2e06b3a01ef5be4d879bcf0.tar.gz
gpgme-0a64c7d0c6d0463cf2e06b3a01ef5be4d879bcf0.zip
Add API gpgme_op_random_bytes.
* src/genrandom.c: New. * src/Makefile.am: Add new file. * src/engine-backend.h (struct engine_ops): Add func ptr getdirect. Adjust all engine_ops. * src/engine-gpg.c (gpg_getdirect): New. (_gpgme_engine_ops_gpg): Connect new handler. * src/gpgme.h.in (gpgme_random_mode_t): New. (GPGME_RANDOM_MODE_NORMAL): New. (GPGME_RANDOM_MODE_ZBASE32): New. (gpgme_op_random_bytes): New public function * src/libgpgme.vers: Add function. * src/gpgme.def: Add function. * tests/run-genrandom.c: New. * tests/Makefile.am: Add new file. -- This is a first take on this the mode parameter allows to extend the function if ever needed. Due to the gpg calling and fd setup overhead this function is not yet very fast but its purpose is to get "approved" random bytes. We might eventually extend it to keep a small internal cache of random numbers and get for example 128 random bytes directly from gpg and deliver only the few required. GnuPG-bug-id: 6694
Diffstat (limited to 'src/engine.h')
-rw-r--r--src/engine.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/engine.h b/src/engine.h
index 8c2d03ca..7befec90 100644
--- a/src/engine.h
+++ b/src/engine.h
@@ -185,6 +185,10 @@ gpgme_error_t _gpgme_engine_op_assuan_transact
gpgme_assuan_status_cb_t status_cb,
void *status_cb_value);
+gpgme_error_t _gpgme_engine_op_getdirect (engine_t engine, const char *argv[],
+ gpgme_data_t dataout,
+ unsigned int flags);
+
gpgme_error_t _gpgme_engine_op_conf_load (engine_t engine,
gpgme_conf_comp_t *conf_p);
gpgme_error_t _gpgme_engine_op_conf_save (engine_t engine,