aboutsummaryrefslogtreecommitdiff
path: root/gost_prov.c
diff options
context:
space:
mode:
authorRichard Levitte <richard@levitte.org>2021-02-13 14:52:39 +0100
committerDmitry Belyavskiy <beldmit@users.noreply.github.com>2021-10-11 19:34:09 +0300
commitbd2d5542f307ae0e9e98a291f0d765a0be58b5fd (patch)
tree86cf8c484f908d225be6f525332948065338800d /gost_prov.c
parent0021eb1fac2d7a6e628b1a4125cecd7520f7b6b6 (diff)
downloadgost-engine-bd2d5542f307ae0e9e98a291f0d765a0be58b5fd.zip
gost-engine-bd2d5542f307ae0e9e98a291f0d765a0be58b5fd.tar.gz
gost-engine-bd2d5542f307ae0e9e98a291f0d765a0be58b5fd.tar.bz2
Making a gost provider - Add the ciphers
We add the ciphers for the provider as wrappers around the routines designed for ENGINEs. This is not the most elegant, but it does the job. When an algorithm has an OID, it's included in the OSSL_ALGORITHM name as an aliase. This is the way to avoid having to register the OIDs in OpenSSL proper. test/03-encrypt.t is modified to test the provider as well.
Diffstat (limited to 'gost_prov.c')
-rw-r--r--gost_prov.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gost_prov.c b/gost_prov.c
index fe65c4d..04f4f3d 100644
--- a/gost_prov.c
+++ b/gost_prov.c
@@ -86,6 +86,10 @@ static const OSSL_ALGORITHM *gost_operation(void *vprovctx,
int operation_id,
const int *no_cache)
{
+ switch (operation_id) {
+ case OSSL_OP_CIPHER:
+ return GOST_prov_ciphers;
+ }
return NULL;
}
@@ -105,6 +109,7 @@ static const OSSL_ITEM *gost_get_reason_strings(void *provctx)
/* The function that tears down this provider */
static void gost_teardown(void *vprovctx)
{
+ GOST_prov_deinit_ciphers();
provider_ctx_free(vprovctx);
}