XRootD
XrdCryptosslRSA.cc File Reference
#include "XrdSut/XrdSutRndm.hh"
#include "XrdCrypto/XrdCryptosslAux.hh"
#include "XrdCrypto/XrdCryptosslTrace.hh"
#include "XrdCrypto/XrdCryptosslRSA.hh"
#include <cstring>
#include <openssl/bio.h>
#include <openssl/err.h>
#include <openssl/pem.h>
+ Include dependency graph for XrdCryptosslRSA.cc:

Go to the source code of this file.

Functions

static RSA * EVP_PKEY_get0_RSA (EVP_PKEY *pkey)
 
static void RSA_get0_key (const RSA *r, const BIGNUM **n, const BIGNUM **e, const BIGNUM **d)
 
static int XrdCheckRSA (EVP_PKEY *pkey)
 

Function Documentation

◆ EVP_PKEY_get0_RSA()

static RSA* EVP_PKEY_get0_RSA ( EVP_PKEY *  pkey)
static

Definition at line 50 of file XrdCryptosslRSA.cc.

51 {
52  if (pkey->type != EVP_PKEY_RSA) {
53  return NULL;
54  }
55  return pkey->pkey.rsa;
56 }

Referenced by XrdCryptosslRSA::XrdCryptosslRSA(), and XrdCheckRSA().

+ Here is the caller graph for this function:

◆ RSA_get0_key()

static void RSA_get0_key ( const RSA *  r,
const BIGNUM **  n,
const BIGNUM **  e,
const BIGNUM **  d 
)
static

Definition at line 58 of file XrdCryptosslRSA.cc.

60 {
61  if (n != NULL)
62  *n = r->n;
63  if (e != NULL)
64  *e = r->e;
65  if (d != NULL)
66  *d = r->d;
67 }

Referenced by XrdCryptosslRSA::XrdCryptosslRSA().

+ Here is the caller graph for this function:

◆ XrdCheckRSA()

static int XrdCheckRSA ( EVP_PKEY *  pkey)
static

Definition at line 70 of file XrdCryptosslRSA.cc.

70  {
71  int rc;
72 #if OPENSSL_VERSION_NUMBER < 0x10101000L
73  RSA *rsa = EVP_PKEY_get0_RSA(pkey);
74  if (rsa)
75  rc = RSA_check_key(rsa);
76  else
77  rc = -2;
78 #else
79  EVP_PKEY_CTX *ckctx = EVP_PKEY_CTX_new(pkey, 0);
80  rc = EVP_PKEY_check(ckctx);
81  EVP_PKEY_CTX_free(ckctx);
82 #endif
83  return rc;
84 }
static RSA * EVP_PKEY_get0_RSA(EVP_PKEY *pkey)

References EVP_PKEY_get0_RSA().

Referenced by XrdCryptosslRSA::XrdCryptosslRSA().

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