Index: doc/cryptography.html ================================================================== --- doc/cryptography.html +++ doc/cryptography.html @@ -28,10 +28,12 @@
tls::macs
tls::protocols
tls::version
 
tls::cmac -cipher name -key key ?options?
+
tls::digest -digest name ?options?
+
tls::hash -digest name ?options?
tls::hmac -digest name -key key ?options?
tls::md -digest name ?options?
tls::md4 data
tls::md5 data
tls::sha1 data
@@ -45,10 +47,12 @@
tls::hkdf -digest digest -key key ?options?
tls::pbkdf2 -size length -digest digest ?options?
tls::scrypt -password string -salt string ?options?
 
tls::random ?-private? length
+
 
+
tls::provider name
OPTIONS
COMMANDS
GLOSSARY
@@ -82,10 +86,12 @@ tls::macs
tls::protocols
tls::version

tls::cmac -cipher name -key key ?options?
+tls::digest -digest name ?options?
+tls::hash -digest name ?options?
tls::hmac -digest name -key key ?options?
tls::md -digest name ?options?
tls::md4 data
tls::md5 data
tls::sha1 data
@@ -99,10 +105,12 @@ tls::hkdf -digest digest -key key ?options?
tls::pbkdf2 -size length -digest digest ?options?
tls::scrypt -password string -salt string ?options?

tls::random ?-private? length
+
+tls::provider name


OPTIONS

@@ -408,10 +416,18 @@
Calculate the Cipher-based Message Authentication Code (CMAC) where key is a shared key and output the result per the I/O options in the specified format. MACs are used to ensure authenticity and the integrity of data. See options for usage info. Option -key is only used for some ciphers.
+ +
tls::digest + option value ...
+
Alias for tls::md.
+ +
tls::hash + option value ...
+
Alias for tls::md.
tls::hmac ?-digest? name -key key ? -bin|-hex @@ -566,10 +582,22 @@ pseudo random generator (CSPRNG). OpenSSL uses a security level of 256 bits. Will return an error if a trusted entropy source such as the OS isn't available. Use -private option if the values are intended to remain private in case the public PRNG is compromised. +
+ +

Load Provider

+These commands provide access to the OpenSSL providers. +
+
+
tls::provider + name
+
Load name default provider. Valid provider names are: + default, base, fips, and legacy. Use + legacy to load the legacy provider ciphers, digests, etc.
+

GLOSSARY

Index: generic/tlsInfo.c ================================================================== --- generic/tlsInfo.c +++ generic/tlsInfo.c @@ -9,10 +9,13 @@ #include "tlsInt.h" #include #include #include +#if OPENSSL_VERSION_NUMBER >= 0x30000000L +#include +#endif /* * Valid SSL and TLS Protocol Versions */ static const char *protocols[] = { @@ -920,10 +923,51 @@ /*******************************************************************/ /* *------------------------------------------------------------------- * + * ProviderObjCmd -- + * + * Load a provider. + * + * Results: + * A standard Tcl result. + * + * Side effects: + * None. + * + *------------------------------------------------------------------- + */ +#if OPENSSL_VERSION_NUMBER >= 0x30000000L +static int +ProviderObjCmd(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { + char *name; + (void) clientData; + + dprintf("Called"); + + /* Validate arg count */ + if (objc != 2) { + Tcl_WrongNumArgs(interp, 1, objv, "provider"); + return TCL_ERROR; + } + + name = Tcl_GetStringFromObj(objv[1], NULL); + if (!OSSL_PROVIDER_try_load(NULL, (const char *) name, 1)) { + Tcl_AppendResult(interp, GET_ERR_REASON(), (char *) NULL); + return TCL_ERROR; + } + + return TCL_OK; +} +#endif + +/*******************************************************************/ + +/* + *------------------------------------------------------------------- + * * VersionObjCmd -- * * Return a string with the OpenSSL version info. * * Results: @@ -982,9 +1026,12 @@ Tcl_CreateObjCommand(interp, "tls::digests", DigestsObjCmd, (ClientData) NULL, (Tcl_CmdDeleteProc *) NULL); Tcl_CreateObjCommand(interp, "tls::kdfs", KdfsObjCmd, (ClientData) NULL, (Tcl_CmdDeleteProc *) NULL); Tcl_CreateObjCommand(interp, "tls::macs", MacsObjCmd, (ClientData) NULL, (Tcl_CmdDeleteProc *) NULL); Tcl_CreateObjCommand(interp, "tls::pkeys", PkeysObjCmd, (ClientData) NULL, (Tcl_CmdDeleteProc *) NULL); Tcl_CreateObjCommand(interp, "tls::protocols", ProtocolsObjCmd, (ClientData) NULL, (Tcl_CmdDeleteProc *) NULL); +#if OPENSSL_VERSION_NUMBER >= 0x30000000L + Tcl_CreateObjCommand(interp, "tls::provider", ProviderObjCmd, (ClientData) NULL, (Tcl_CmdDeleteProc *) NULL); +#endif Tcl_CreateObjCommand(interp, "tls::version", VersionObjCmd, (ClientData) NULL, (Tcl_CmdDeleteProc *) NULL); return TCL_OK; }