Skip to content

Commit

Permalink
adding provider-specific version information (#45)
Browse files Browse the repository at this point in the history
* adding provider-specific version information
  • Loading branch information
baentsch authored Jan 12, 2022
1 parent 2ef5710 commit 768ce13
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ to be located in a folder `.local` in the local directory as per the
building examples above. Installing openssl(3.0) in a standard location
eliminates the need for specific PATH setting as showcased below.

## Checking provider version information

LD_LIBRARY_PATH=.local/lib .local/bin/openssl list -providers -verbose -provider-path _build/oqsprov -provider oqsprovider

## Creating (classic) keys and certificates

This can be facilitated for example by running
Expand Down
2 changes: 2 additions & 0 deletions oqsprov/oqs_prov.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
# include <openssl/core.h>
# include <openssl/e_os2.h>

#define OQS_PROVIDER_VERSION_STR "0.3.0"

/* internal, but useful OSSL define */
# define OSSL_NELEM(x) (sizeof(x)/sizeof((x)[0]))

Expand Down
6 changes: 4 additions & 2 deletions oqsprov/oqsprov.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,8 @@ static const OSSL_PARAM *oqsprovider_gettable_params(void *provctx)
return oqsprovider_param_types;
}

#define OQS_PROVIDER_BUILD_INFO_STR "OQS Provider v." OQS_PROVIDER_VERSION_STR " based on liboqs v." OQS_VERSION_TEXT

static int oqsprovider_get_params(void *provctx, OSSL_PARAM params[])
{
OSSL_PARAM *p;
Expand All @@ -297,10 +299,10 @@ static int oqsprovider_get_params(void *provctx, OSSL_PARAM params[])
if (p != NULL && !OSSL_PARAM_set_utf8_ptr(p, "OpenSSL OQS Provider"))
return 0;
p = OSSL_PARAM_locate(params, OSSL_PROV_PARAM_VERSION);
if (p != NULL && !OSSL_PARAM_set_utf8_ptr(p, OPENSSL_VERSION_STR))
if (p != NULL && !OSSL_PARAM_set_utf8_ptr(p, OQS_PROVIDER_VERSION_STR))
return 0;
p = OSSL_PARAM_locate(params, OSSL_PROV_PARAM_BUILDINFO);
if (p != NULL && !OSSL_PARAM_set_utf8_ptr(p, OPENSSL_FULL_VERSION_STR))
if (p != NULL && !OSSL_PARAM_set_utf8_ptr(p, OQS_PROVIDER_BUILD_INFO_STR))
return 0;
p = OSSL_PARAM_locate(params, OSSL_PROV_PARAM_STATUS);
if (p != NULL && !OSSL_PARAM_set_int(p, 1)) // provider is always running
Expand Down
3 changes: 3 additions & 0 deletions scripts/runtests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ interop() {
provider2openssl $1 && openssl2provider $1
}

# Output version:
LD_LIBRARY_PATH=.local/lib64 .local/bin/openssl list -providers -verbose -provider-path _build/oqsprov -provider oqsprovider

# Run built-in tests:
(cd _build; ctest $@)

Expand Down

0 comments on commit 768ce13

Please sign in to comment.