aboutsummaryrefslogtreecommitdiff
path: root/gost_prov.c
AgeCommit message (Collapse)AuthorFilesLines
2022-01-10gost_prov: OPENSSL_free what is OPENSSL_zalloc'dVitaly Chikunov1-1/+1
*** CID 345254: API usage errors (ALLOC_FREE_MISMATCH) /gost_prov.c: 71 in provider_ctx_new() 65 && populate_gost_engine(ctx->e)) { 66 ctx->core_handle = core; 67 68 /* Ugly hack */ 69 err_handle = ctx->proverr_handle; 70 } else { >>> CID 345254: API usage errors (ALLOC_FREE_MISMATCH) >>> Calling "provider_ctx_free" frees "ctx" using "free" but it should have been freed using "CRYPTO_free". 71 provider_ctx_free(ctx); 72 ctx = NULL; 73 } 74 return ctx; 75 } Fixes: f5a3951 ("gost_prov: Avoid access to unallocated memory") Signed-off-by: Vitaly Chikunov <vt@altlinux.org>
2022-01-09gost_prov: Avoid access to unallocated memoryVitaly Chikunov1-1/+1
This should fix Coverity warning: *** CID 345245: (UNINIT) /gost_prov.c: 71 in provider_ctx_new() 65 && populate_gost_engine(ctx->e)) { 66 ctx->core_handle = core; 67 68 /* Ugly hack */ 69 err_handle = ctx->proverr_handle; 70 } else { >>> CID 345245: (UNINIT) >>> Using uninitialized value "ctx->e" when calling "provider_ctx_free". 71 provider_ctx_free(ctx); 72 ctx = NULL; 73 } 74 return ctx; 75 } Signed-off-by: Vitaly Chikunov <vt@altlinux.org> Issue: #380
2021-12-20Output provider infoVitaly Chikunov1-0/+10
Output something in `openssl list -providers` so it's merrier. Signed-off-by: Vitaly Chikunov <vt@altlinux.org>
2021-12-11MSVC: Add dllexport to OSSL_provider_initVitaly Chikunov1-0/+1
`OSSL_provider_init' requires dllexport attribute to be visible (and thus loadable) in DLL. Link: https://github.com/openssl/openssl/issues/17203 Signed-off-by: Vitaly Chikunov <vt@altlinux.org>
2021-10-11Making a gost provider - Add the macsRichard Levitte1-0/+3
We add the macs for the provider as wrappers around the EVP_MD implementations 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 alias. This is the way to avoid having to register the OIDs in OpenSSL proper.
2021-10-11Making a gost provider - Add the digestsRichard Levitte1-0/+3
We add the digests 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/01-digest.t is modified to test the provider as well.
2021-10-11Making a gost provider - Add the ciphersRichard Levitte1-0/+5
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.
2021-10-11Making a gost provider - Add the provider foundationRichard Levitte1-0/+144
This adds the source to get a minimal provider that provides... nothing.