XRootD
XrdCryptoLite_bf32.cc File Reference
+ Include dependency graph for XrdCryptoLite_bf32.cc:

Go to the source code of this file.

Functions

XrdCryptoLiteXrdCryptoLite_New_bf32 (const char Type)
 

Function Documentation

◆ XrdCryptoLite_New_bf32()

XrdCryptoLite* XrdCryptoLite_New_bf32 ( const char  Type)

Definition at line 181 of file XrdCryptoLite_bf32.cc.

182 {
183 #ifdef HAVE_SSL
184 #if OPENSSL_VERSION_NUMBER < 0x10100000L
185  // In case nothing has yet configured a libcrypto thread-id callback
186  // function we provide one via the XrdTlsContext Init method. Compared
187  // to the default the aim is to provide better properies when libcrypto
188  // uses the thread-id as hash-table keys for the per-thread error state.
189  static struct configThreadid {
190  configThreadid() {eText = XrdTlsContext::Init();}
191  const char *eText;
192  } ctid;
193  // Make sure all went well
194  //
195  if (ctid.eText) return (XrdCryptoLite *)0;
196 #endif
197 #if OPENSSL_VERSION_NUMBER >= 0x30000000L
198  // With openssl v3 the blowfish cipher is only available via the "legacy"
199  // provider. Legacy is typically not enabled by default (but can be via
200  // openssl.cnf) so it is loaded here. Explicitly loading a provider will
201  // disable the automatic loading of the "default" one. The default might
202  // not have already been loaded, or standard algorithms might be available
203  // via another configured provider, such as FIPS. So an attempt is made to
204  // fetch a common default algorithm, possibly automaticlly loading the
205  // default provider. Afterwards the legacy provider is loaded.
206  static struct loadProviders {
207  loadProviders() {
208  EVP_MD *mdp = EVP_MD_fetch(NULL, "SHA2-256", NULL);
209  if (mdp) EVP_MD_free(mdp);
210  // Load legacy provider into the default (NULL) library context
211  (void) OSSL_PROVIDER_load(NULL, "legacy");
212  }
213  } lp;
214 #endif
215  return (XrdCryptoLite *)(new XrdCryptoLite_bf32(Type));
216 #else
217  return (XrdCryptoLite *)0;
218 #endif
219 }
static const char * Init()

References XrdTlsContext::Init().

Referenced by XrdCryptoLite::Create().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: