20#include "RConfigure.h" 
   52#if !defined(R__WIN32) && !defined(R__MACOSX) && !defined(R__FBSD) && \ 
   59#if defined(R__LINUX) || defined(R__FBSD) || defined(R__OBSD) 
   68extern "C" char *
crypt(
const char *, 
const char *);
 
   73#   include <openssl/bio.h> 
   74#   include <openssl/err.h> 
   75#   include <openssl/pem.h> 
   76#   include <openssl/rand.h> 
   77#   include <openssl/rsa.h> 
   78#   include <openssl/ssl.h> 
   79#   include <openssl/blowfish.h> 
   93                                                "Unsupported", 
"Unsupported", 
"Unsupported" };
 
  139      if (
rs == 
sizeof(
int)) 
return r;
 
  141   Printf(
"+++ERROR+++ : auth_rand: neither /dev/urandom nor /dev/random are available or readable!");
 
  145      memcpy((
void *)&
t1, (
void *)&
tv.tv_sec, 
sizeof(
int));
 
  146      memcpy((
void *)&
t2, (
void *)&
tv.tv_usec, 
sizeof(
int));
 
 
  162                             const char *
proto, 
const char *user)
 
  182      Info(
"TAuthenticate", 
"Enter: local host: %s, user is: %s (proto: %s)",
 
  212            Info(
"TAuthenticate",
 
  213                 "service: %s (remote protocol: %d): fVersion: %d", 
sproto,
 
  223   if (user && 
strlen(user) > 0) {
 
  248      Info(
"TAuthenticate",
"RSA key: default type %d", 
fgRSAKey);
 
  268      Info(
"TAuthenticate",
 
  269           "number of HostAuth Instantiations in memory: %d",
 
  293   tmp.ReplaceAll(
"root",4,
"",0);
 
  294   tmp.ReplaceAll(
"sock",4,
"",0);
 
  295   if (!
strncmp(tmp.Data(),
"up",2))
 
  297   else if (!
strncmp(tmp.Data(),
"s",1))
 
  299   else if (!
strncmp(tmp.Data(),
"k",1))
 
  301   else if (!
strncmp(tmp.Data(),
"g",1))
 
  303   else if (!
strncmp(tmp.Data(),
"h",1))
 
  305   else if (!
strncmp(tmp.Data(),
"ug",2))
 
 
  333   Info(
"CatchTimeOut", 
"%d sec timeout expired (protocol: %s)",
 
 
  372      alarm->SetInterruptSyscalls();
 
  374      alarm->Connect(
"Timeout()", 
"TAuthenticate", 
this, 
"CatchTimeOut()");
 
  382      Info(
"Authenticate", 
"try #: %d", 
ntry);
 
  393           "trying authentication: method:%d, default details:%s",
 
  437         Error(
"Authenticate",
 
  438               "unable to get user name for UsrPwd authentication");
 
  458      Info(
"Authenticate",
"remloc: %d, ntry: %d, meth: %d, fSecurity: %d",
 
  484                 "negotiation not supported remotely: try next method, if any");
 
  502              "after failed attempt: kind= %d, stat= %d", kind, stat);
 
  519                       "strings with accepted methods not received (%d:%d)",
 
  526                    "remotely allowed methods not yet tried: %s",
 
  529         } 
else if (stat == 0) {
 
  531                 "no more methods accepted remotely to be tried");
 
  546         for (i = 0; i < 
remMeth; i++) {
 
  563            Warning(
"Authenticate", 
"no match with those locally available: %s", 
available.c_str());
 
  580              "method not even started: insufficient or wrong info: %s",
 
  581              "try with next method, if any");
 
  598                    "status code -2 not expected from old daemons");
 
  610         Info(
"Authenticate", 
"got a timeout");
 
  622         Info(
"Authenticate", 
"unknown status code: %d - assume failure",
st);
 
  637         Info(
"Authenticate", 
"attempted methods %s are not supported" 
  640           "failure: list of attempted methods: %s", 
triedMeth);
 
 
  664      Info(
"SetEnvironment",
 
  665           "setting environment: fSecurity:%d, fDetails:%s", 
fSecurity,
 
  676      char pt[5] = { 0 }, 
ru[5] = { 0 };
 
  704      if ((
pd = 
hours.Index(
":")) > -1) {
 
  722            Info(
"SetEnvironment", 
"details:%s, pt:%s, ru:%s, us:%s cp:%s",
 
  728            Info(
"SetEnvironment", 
"details:%s, pt:%s, ru:%s, us:%s",
 
 
  785      Error(
"GetUserPasswd", 
"SRP no longer supported by ROOT");
 
  790      Info(
"GetUserPasswd", 
"Enter: User: '%s' Hash:%d SRP:%d",
 
  794   if (user == 
"" && 
fgUser != 
"")
 
  805      Info(
"GetUserPasswd", 
"In memory: User: '%s' Hash:%d",
 
  815         Info(
"GetUserPasswd", 
"In memory: User: '%s' Hash:%d",
 
  821   if (user == 
"" || 
passwd == 
"") {
 
  823         Info(
"GetUserPasswd", 
"Checking .netrc family ...");
 
  827      Info(
"GetUserPasswd", 
"From .netrc family: User: '%s' Hash:%d",
 
  836         Error(
"GetUserPasswd", 
"user name not set");
 
 
  883      Error(
"CheckNetrc", 
"SRP no longer supported by ROOT");
 
  933               href.ReplaceAll(
"*",
".*");
 
  957                    "file %s exists but has not 0600 permission", 
net);
 
 
 1015   ::Error(
"Krb5Auth", 
"Kerberos5 is no longer supported by ROOT");
 
 
 1043      ::Error(
"Authenticate::GetAuthMethod", 
"idx out of bounds (%d)", idx);
 
 
 1088                "not tty: cannot prompt for user, returning default");
 
 1098      usr.Remove(
usr.Length() - 1); 
 
 
 1116      ::Warning(
"TAuthenticate::PromptPasswd",
 
 1117                "not tty: cannot prompt for passwd, returning -1");
 
 1118      static char noint[4] = {
"-1"};
 
 1123   const char *
pw = buf;
 
 1128           gROOT->GetPluginManager()->FindHandler(
"TGPasswdDialog"))) {
 
 1132                      "could not load plugin for the password dialog box");
 
 1142      while (
gROOT->IsInterrupted())
 
 1154      if (
spw.EndsWith(
"\n"))
 
 1155         spw.Remove(
spw.Length() - 1);   
 
 
 1175   key = (key >= 0 && key <= 1) ? key : 0;
 
 
 1192   if (key >= 0 && key <= 1)
 
 
 1232      lasterr = 
"(last error only; re-run with gDebug > 0 for more details)";
 
 1241            ::Error(
Form(
"TAuthenticate::%s", 
where),
 
 1242                    "unknown error code: server must be running a newer ROOT version %s",
 
 
 1260   if (user && user[0])
 
 
 1291   ::Error(
"SetGlobalSRPPwd", 
"SRP no longer supported by ROOT");
 
 
 1352   ::Error(
"Krb5Auth", 
"Kerberos5 is no longer supported by ROOT");
 
 
 1361   ::Error(
"GlobusAuth", 
"Globus is no longer supported by ROOT");
 
 
 1369   ::Error(
"SshAuth", 
"SSH is no longer supported by ROOT");
 
 
 1378   ::Error(
"GetSshUser", 
"SSH is no longer supported by ROOT");
 
 
 1425         ::Info(
"TAuthenticate::CheckHost", 
"checking host IP: %s", 
theHost.Data());
 
 
 1448   ::Error(
"RfioAuth", 
"RfioAuth is no longer supported by ROOT");
 
 
 1462      Info(
"ClearAuth", 
"enter: user: %s (passwd hashed?: %d)",
 
 1474      Info(
"ClearAuth", 
"ru:%d pt:%d cp:%d ns:%d rk:%d",
 
 1503      options.
Form(
"%d %ld %s %ld %s", opt,
 
 1525            Info(
"ClearAuth", 
"anonymous user");
 
 1534      char ctag[11] = {0};
 
 1542                       "problems recvn RSA key flag: got message %d, flag: %d",
 
 1548            Info(
"ClearAuth", 
"get key request ...");
 
 1562               Warning(
"ClearAuth", 
"problems secure-receiving salt -" 
 1563                       " may result in corrupted salt");
 
 1564               Warning(
"ClearAuth", 
"switch off reuse for this session");
 
 1595               Info(
"ClearAuth", 
"got salt: '%s' (len: %d)", 
salt.Data(), 
slen);
 
 1598               Info(
"ClearAuth", 
"Salt not required");
 
 1601               Warning(
"ClearAuth", 
"problems secure-receiving rndmtag -" 
 1602                       " may result in corrupted rndmtag");
 
 1639                    "automatically generated anonymous passwd: %s",
 
 1654                  Error(
"ClearAuth", 
"password not set");
 
 1697            Warning(
"ClearAuth", 
"problems secure-sending pass hash" 
 1698                    " - may result in authentication failure");
 
 1705            for (
int i = 0; i < 
passwd.Length(); i++) {
 
 1719         Info(
"ClearAuth", 
"after kROOTD_PASS: kind= %d, stat= %d", kind,
 
 1731                 "problems recvn (user,offset) length (%d:%d bytes:%d)",
 
 1736      int reclen = (stat+1 > 256) ? 256 : stat+1;
 
 1741                 "username and offset not received (%d:%d)", kind,
 
 1750              "received from server: user: %s, offset: %d (%s)", 
lUser,
 
 1762                       "problems secure-receiving token -" 
 1763                       " may result in corrupted token");
 
 1768            token = 
new char[
tlen];
 
 1774               Warning(
"ClearAuth", 
"token not received (%d:%d)", kind,
 
 1777            for (
int i = 0; i < (
int) 
strlen(token); i++) {
 
 1783            Info(
"ClearAuth", 
"received from server: token: '%s' ",
 
 1835                     "%s@%s does not accept connections from %s@%s",
 
 1842                     "%s@%s does not accept %s authentication from %s@%s",
 
 1859            Error(
"ClearAuth", 
"password not set");
 
 1861      if (
fUser == 
"anonymous" || 
fUser == 
"rootd") {
 
 1862         if (!
passwd.Contains(
"@")) {
 
 1864                    "please use passwd of form: user@host.do.main");
 
 1875         for (
int i = 0; i < 
passwd.Length(); i++) {
 
 1888         Info(
"ClearAuth", 
"after kROOTD_PASS: kind= %d, stat= %d", kind,
 
 
 1916      ::Info(
"TAuthenticate::GetHostAuth", 
"enter ... %s ... %s", host, user);
 
 1922      char *ps = (
char *)
strstr(host,
":");
 
 1946         ai->Print(
"Authenticate::GetHostAuth");
 
 
 1985      ::Info(
"TAuthenticate::HasHostAuth", 
"enter ... %s ... %s", host, user);
 
 1991      char *ps = (
char *)
strstr(host,
":");
 
 
 2028      ::Info(
"TAuthenticate::FileExpand", 
"enter ... '%s' ... 0x%zx", 
fexp, (
size_t)
ftmp);
 
 2041         ::Info(
"TAuthenticate::FileExpand", 
"read line ... '%s'", 
line);
 
 2052         ln.ReplaceAll(
"\"",1,
"",0);
 
 2053         ln.ReplaceAll(
"'",1,
"",0);
 
 2060            if (
edir.Contains(
"/")) {
 
 2088                      "file specified by 'include' cannot be open or read (%s)",
 
 
 2103   const char copt[2][5] = { 
"no", 
"yes" };
 
 2106      ::Info(
"TAuthenticate::GetDefaultDetails",
 
 2107             "enter ... %d ...pt:%d ... '%s'", 
sec, opt, 
usr);
 
 2123      ::Info(
"TAuthenticate::GetDefaultDetails", 
"returning ... %s", temp);
 
 
 2157      ::Info(
"::Print", 
" +--------------------------- BEGIN --------------------------------+");
 
 2158      ::Info(
"::Print", 
" +                                                                  +");
 
 2159      ::Info(
"::Print", 
" + List fgAuthInfo has %4d members                                 +",
 
 2161      ::Info(
"::Print", 
" +                                                                  +");
 
 2162      ::Info(
"::Print", 
" +------------------------------------------------------------------+");
 
 2167         ai->PrintEstablished();
 
 2169      ::Info(
"::Print", 
" +---------------------------- END ---------------------------------+");
 
 
 2185      Info(
"AuthExists",
"%d: enter: msg: %d options: '%s'",
 
 2186           method,*message, options);
 
 2225      token = 
secctx->GetToken();
 
 2228              "found valid TSecContext: offset: %d token: '%s'",
 
 2249      Int_t stat = 1, kind;
 
 2254            Warning(
"AuthExists",
"protocol error: expecting %d got %d" 
 2260            Info(
"AuthExists",
"offset OK");
 
 2280               Warning(
"AuthExists", 
"problems secure-sending token %s",
 
 2281                       "- may trigger problems in proofing Id ");
 
 2286            for (
int i = 0; i < token.
Length(); i++) {
 
 2295            Info(
"AuthExists",
"offset not OK - rerun authentication");
 
 2306      Info(
"AuthExists",
"%d: after msg %d: kind= %d, stat= %d",
 
 2307           method,*message, kind, stat);
 
 2318         Error(
"AuthExists",
"%s@%s does not accept connections from %s@%s",
 
 2324                 "%s@%s does not accept %s authentication from %s@%s",
 
 2342            Info(
"AuthExists", 
"valid authentication exists");
 
 2344            Info(
"AuthExists", 
"valid authentication exists: offset changed");
 
 2346            Info(
"AuthExists", 
"remote access authorized by /etc/hosts.equiv");
 
 2348            Info(
"AuthExists", 
"no authentication required remotely");
 
 
 2378      const char *
randdev = 
"/dev/urandom";
 
 2384         if (read(fd, &seed, 
sizeof(seed)) != 
sizeof(seed))
 
 2389            ::Info(
"InitRandom", 
"%s not available: using time()", 
randdev);
 
 
 2404      Info(
"GenRSAKeys", 
"enter");
 
 2408         Info(
"GenRSAKeys", 
"Keys prviously generated - return");
 
 2430         Info(
"GenRSAKeys",
"SSL: Generate Blowfish key");
 
 2500            Info(
"GenRSAKeys", 
"equal primes: regenerate (%d times)",
nPrimes);
 
 2508         Info(
"GenRSAKeys", 
"local: p1: '%s' ", buf);
 
 2510         Info(
"GenRSAKeys", 
"local: p2: '%s' ", buf);
 
 2516            Info(
"GenRSAKeys",
" genrsa: unable to generate keys (%d)",
 
 2533         Info(
"GenRSAKeys", 
"local: n: '%s' length: %d", 
buf_n, 
l_n);
 
 2534         Info(
"GenRSAKeys", 
"local: e: '%s' length: %d", 
buf_e, 
l_e);
 
 2535         Info(
"GenRSAKeys", 
"local: d: '%s' length: %d", 
buf_d, 
l_d);
 
 2551         Info(
"GenRSAKeys", 
"local: test string: '%s' ", 
test);
 
 2560              "local: length of crypted string: %d bytes", 
lout);
 
 2566         Info(
"GenRSAKeys", 
"local: after private/public : '%s' ", buf);
 
 2577         Info(
"GenRSAKeys", 
"local: length of crypted string: %d bytes ",
 
 2584         Info(
"GenRSAKeys", 
"local: after public/private : '%s' ", buf);
 
 2603      Info(
"GenRSAKeys", 
"local: generated keys are:");
 
 2604      Info(
"GenRSAKeys", 
"local: n: '%s' length: %d", 
buf_n, 
l_n);
 
 2605      Info(
"GenRSAKeys", 
"local: e: '%s' length: %d", 
buf_e, 
l_e);
 
 2606      Info(
"GenRSAKeys", 
"local: d: '%s' length: %d", 
buf_d, 
l_d);
 
 
 2647   unsigned int iimx[4][4] = {
 
 2648      {0x0, 0xffffff08, 0xafffffff, 0x2ffffffe}, 
 
 2649      {0x0, 0x3ff0000, 0x7fffffe, 0x7fffffe},    
 
 2650      {0x0, 0x3ff0000, 0x7e, 0x7e},              
 
 2651      {0x0, 0x3ffc000, 0x7fffffe, 0x7fffffe}     
 
 2654   const char *
cOpt[4] = { 
"Any", 
"LetNum", 
"Hex", 
"Crypt" };
 
 2660         Info(
"GetRandString", 
"unknown option: %d : assume 0", opt);
 
 2663      Info(
"GetRandString", 
"enter ... len: %d %s", 
len, 
cOpt[opt]);
 
 2666   char *buf = 
new char[
len + 1];
 
 2676      for (
m = 7; 
m < 32; 
m += 7) {
 
 2677         i = 0x7F & (
frnd >> 
m);
 
 2680         if ((
iimx[opt][
j] & (1 << 
l))) {
 
 2692      Info(
"GetRandString", 
"got '%s' ", buf);
 
 
 2704                                Int_t key, 
const char *str)
 
 2710      ::Info(
"TAuthenticate::SecureSend", 
"local: enter ... (enc: %d)", 
enc);
 
 2727   } 
else if (key == 1) {
 
 2733      unsigned char iv[8];
 
 2739         ::Info(
"TAuthenticate::SecureSend",
"not compiled with SSL support:" 
 2740                " you should not have got here!");
 
 2744         ::Info(
"TAuthenticate::SecureSend",
"unknown key type (%d)",key);
 
 2753      ::Info(
"TAuthenticate::SecureSend",
 
 2754             "local: sent %d bytes (expected: %d)", 
nsen,
ttmp);
 
 
 2776   if (sock->
Recv(buflen, 20, kind) < 0)
 
 2780      ::Info(
"TAuthenticate::SecureRecv", 
"got len '%s' %d (msg kind: %d)",
 
 2785   if (!
strncmp(buflen, 
"-1", 2))
 
 2802      if (*str == 
nullptr) {
 
 2804            ::Info(
"TAuthenticate::SecureRecv",
"Memory allocation error size (%ld)", (
long) 
strSize);
 
 2809   } 
else if (key == 1) {
 
 2811      unsigned char iv[8];
 
 2813      *str = 
new char[
nrec + 1];
 
 2816      (*str)[
nrec] = 
'\0';
 
 2819         ::Info(
"TAuthenticate::SecureRecv",
"not compiled with SSL support:" 
 2820                " you should not have got here!");
 
 2824         ::Info(
"TAuthenticate::SecureRecv",
"unknown key type (%d)",key);
 
 
 2843      ::Info(
"TAuthenticate::DecodeRSAPublic",
 
 2849      ::Info(
"TAuthenticate::DecodeRSAPublic",
 
 2862      while (str[k] == 32) k++;
 
 2864      if (str[k] == 
'#') {
 
 2878               ::Info(
"TAuthenticate::DecodeRSAPublic",
 
 2885               ::Info(
"TAuthenticate::DecodeRSAPublic",
 
 2895            ::Info(
"TAuthenticate::DecodeRSAPublic",
"bad format for input string");
 
 2912               ::Info(
"TAuthenticate::DecodeRSAPublic",
 
 2913                        "unable to read pub key from bio");
 
 2918               ::Info(
"TAuthenticate::DecodeRSAPublic",
 
 2919                        "no space allocated for output variable");
 
 2926            ::Info(
"TAuthenticate::DecodeRSAPublic",
"not compiled with SSL support:" 
 2927                   " you should not have got here!");
 
 
 2942      ::Info(
"TAuthenticate::SetRSAPublic",
 
 2985         ::Info(
"TAuthenticate::SetRSAPublic",
" Key type: %d",
rsakey);
 
 3003            ::Info(
"TAuthenticate::SetRSAPublic",
 
 3004                   "not compiled with SSL support:" 
 3005                   " you should not have got here!");
 
 
 3025      ::Info(
"TAuthenticate::SendRSAPublicKey",
 
 3046   char buflen[20] = {0};
 
 3053   } 
else if (key == 1) {
 
 3067            ::Info(
"TAuthenticate::SendRSAPublicKey",
"SSL: error: '%s' ",
errstr);
 
 3077         ::Info(
"TAuthenticate::SendRSAPublicKey",
"not compiled with SSL support:" 
 3078                " you should not have got here!");
 
 3083         ::Info(
"TAuthenticate::SendRSAPublicKey",
"unknown key type (%d)",key);
 
 3097      ::Info(
"TAuthenticate::SendRSAPublicKey",
 
 3098             "local: sent %d bytes (expected: %d)", 
nsen,
ttmp);
 
 
 3122      ::Info(
"TAuthenticate::ReadRootAuthrc", 
"Checking file: %s", 
authrc);
 
 3125         ::Info(
"TAuthenticate::ReadRootAuthrc",
 
 3126                "file %s cannot be read (errno: %d)", 
authrc, 
errno);
 
 3130         ::Info(
"TAuthenticate::ReadRootAuthrc", 
"Checking system file: %s", 
authrc);
 
 3133            ::Info(
"TAuthenticate::ReadRootAuthrc",
 
 3134                   "file %s cannot be read (errno: %d)", 
authrc, 
errno);
 
 3147            ::Info(
"TAuthenticate::ReadRootAuthrc",
 
 3148                   "file %s already read", 
authrc);
 
 3166      ::Info(
"TAuthenticate::ReadRootAuthrc", 
"got tmp file: %s open at 0x%zx",
 
 3182            ::Info(
"TAuthenticate::ReadRootAuthrc",
 
 3183                   "file %s cannot be open (errno: %d)", 
authrc, 
errno);
 
 3208      char *tmp = 
new char[
tmpSize];
 
 3210         ::Error(
"TAuthenticate::ReadRootAuthrc",
 
 3211                 "could not allocate temporary buffer");
 
 3251            if (host == 
ha->GetHost() && user == 
ha->GetUser() &&
 
 3271                     ::Info(
"TAuthenticate::ReadRootAuthrc",
 
 3272                            "unrecognized method (%s): ", 
mth);
 
 3292                  ::Info(
"TAuthenticate::ReadRootAuthrc",
 
 3293                         "unrecognized method (%s): ", 
mth);
 
 3298               const char *
det = 0;
 
 3303               if (
ha->HasMethod(
met))
 
 3309      if (tmp) 
delete [] tmp;
 
 
 3360      if (!
ha->IsActive()) {
 
 3370      if (
hanew->NumMethods()) {
 
 3379            hanew->DeActivate();
 
 3386         hanew->DeActivate();
 
 3392      if (!
hanew->IsActive()) {
 
 
 3411      TIter next(
ha->Established());
 
 3415            ha->Established()->Remove(ctx);
 
 
const Int_t kAUTH_SSALT_MSK
 
const Int_t kAUTH_CRYPT_MSK
 
const Int_t kAUTH_REUSE_MSK
 
const Int_t kAUTH_RSATY_MSK
 
R__EXTERN const char * gRootdErrStr[]
 
bool Bool_t
Boolean (0=false, 1=true) (bool)
 
int Int_t
Signed integer 4 bytes (int)
 
long Long_t
Signed long integer 4 bytes (long). Size depends on architecture.
 
constexpr Ssiz_t kNPOS
The equivalent of std::string::npos for the ROOT class TString.
 
const char Option_t
Option string (const char)
 
TVirtualMutex * gAuthenticateMutex
 
Int_t StdCheckSecCtx(const char *, TRootSecContext *)
Standard version of CheckSecCtx to be passed to TAuthenticate::AuthExists Check if User is matches th...
 
R__rsa_KEY_export R__fgRSAPubExport[2]
 
static int auth_rand()
rand() implementation using /udev/random or /dev/random, if available
 
R__EXTERN TVirtualMutex * gAuthenticateMutex
 
Int_t(* Krb5Auth_t)(TAuthenticate *auth, TString &user, TString &det, Int_t version)
 
Int_t(* SecureAuth_t)(TAuthenticate *auth, const char *user, const char *passwd, const char *remote, TString &det, Int_t version)
 
Int_t(* GlobusAuth_t)(TAuthenticate *auth, TString &user, TString &det)
 
Int_t(* CheckSecCtx_t)(const char *subj, TRootSecContext *ctx)
 
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
 
winID h TVirtualViewer3D TVirtualGLPainter p
 
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h offset
 
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
 
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
 
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t UChar_t len
 
Int_t gDebug
Global variable setting the debug level. Set to 0 to disable, increase it in steps of 1 to increase t...
 
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
 
void Printf(const char *fmt,...)
Formats a string in a circular formatting buffer and prints the string.
 
char * StrDup(const char *str)
Duplicate the string str.
 
Bool_t R_ISREG(Int_t mode)
 
Bool_t R_ISDIR(Int_t mode)
 
R__EXTERN TSystem * gSystem
 
#define R__LOCKGUARD2(mutex)
 
static void RemoveHostAuth(THostAuth *ha, Option_t *opt="")
Remove THostAuth instance from the list.
 
static Int_t SetRSAPublic(const char *rsapubexport, Int_t klen)
Store RSA public keys from export string rsaPubExport.
 
static TPluginHandler * fgPasswdDialog
 
static void SetGlobalSRPPwd(Bool_t srppwd)
Set global SRP passwd flag to be used for authentication to rootd.
 
static Bool_t fgPromptUser
 
TRootSecContext * fSecContext
 
static void FileExpand(const char *fin, FILE *ftmp)
Expands include directives found in fexp files The expanded, temporary file, is pointed to by 'ftmp' ...
 
static const char * GetGlobalUser()
Static method returning the global user.
 
static void SetGlobalUser(const char *user)
Set global user name to be used for authentication to rootd.
 
static void SetPromptUser(Bool_t promptuser)
Set global PromptUser flag.
 
Int_t RfioAuth(TString &user)
RFIO authentication (no longer supported)
 
static void Show(Option_t *opt="S")
Print info about the authentication sector.
 
const char * GetSshUser(TString user) const
Method returning the user to be used for the ssh login (no longer supported)
 
static const char * GetDefaultUser()
Static method returning the default user information.
 
static Bool_t GetPromptUser()
Static method returning the prompt user settings.
 
static Int_t SecureRecv(TSocket *Socket, Int_t dec, Int_t KeyType, char **Out)
Receive str from sock and decode it using key indicated by key type Return number of received bytes o...
 
static const char * GetKrb5Principal()
Static method returning the principal to be used to init Krb5 tickets.
 
THostAuth * GetHostAuth() const
 
static void SetAuthReUse(Bool_t authreuse)
Set global AuthReUse flag.
 
static R__rsa_KEY_export * fgRSAPubExport
 
char * GetRandString(Int_t Opt, Int_t Len)
Allocates and fills a 0 terminated buffer of length len+1 with len random characters.
 
Int_t SshAuth(TString &user)
SSH client authentication code (no longer supported)
 
static char * PromptPasswd(const char *prompt="Password: ")
Static method to prompt for the user's passwd to be used for authentication to rootd.
 
static void SetDefaultUser(const char *defaultuser)
Set default user name.
 
static void SetGlobalPwHash(Bool_t pwhash)
Set global passwd hash flag to be used for authentication to rootd.
 
static void SetGlobalExpDate(TDatime expdate)
Set default expiring date for new validity contexts.
 
static Int_t GetRSAInit()
Static method returning the RSA initialization flag.
 
static void SetSecureAuthHook(SecureAuth_t func)
Set secure authorization function.
 
static Int_t GetClientProtocol()
Static method returning supported client protocol.
 
static Int_t ReadRootAuthrc()
Read authentication directives from $ROOTAUTHRC, $HOME/.rootauthrc or <Root_etc_dir>/system....
 
static Bool_t fgReadHomeAuthrc
 
static Int_t SecureSend(TSocket *Socket, Int_t enc, Int_t KeyType, const char *In)
Encode null terminated str using the session private key indicated by enc and sends it over the netwo...
 
Int_t GenRSAKeys()
Generate a valid pair of private/public RSA keys to protect for authentication token exchange.
 
Bool_t CheckNetrc(TString &user, TString &passwd)
Try to get user name and passwd from the ~/.rootnetrc or ~/.netrc files.
 
static const char * GetRSAPubExport(Int_t key=0)
Static method returning the RSA public keys.
 
static void InitRandom()
Initialize random machine using seed from /dev/urandom (or current time if /dev/urandom not available...
 
static R__rsa_KEY fgRSAPubKey
 
static Bool_t fgAuthReUse
 
static Bool_t GetGlobalPwHash()
Static method returning the global password hash flag.
 
static void SetKrb5AuthHook(Krb5Auth_t func)
Set kerberos5 authorization function.
 
static void SetGlobusAuthHook(GlobusAuth_t func)
Set Globus authorization function.
 
static void SetRSAInit(Int_t init=1)
Static method setting RSA initialization flag.
 
static void SetGlobalPasswd(const char *passwd)
Set global passwd to be used for authentication to rootd.
 
void SetEnvironment()
Set default authentication environment.
 
static Int_t SendRSAPublicKey(TSocket *Socket, Int_t key=0)
Receives server RSA Public key Sends local RSA public key encoded.
 
static TDatime fgLastAuthrc
 
static TList * fgAuthInfo
 
static TString fgAuthMeth[kMAXSEC]
 
void CatchTimeOut()
Called in connection with a timer timeout.
 
Bool_t GetUserPasswd(TString &user, TString &passwd, Bool_t &pwhash, Bool_t srppwd)
Try to get user name and passwd from several sources.
 
Bool_t Authenticate()
Authenticate to remote rootd server.
 
static R__rsa_KEY fgRSAPriKey
 
static TString fgRootAuthrc
 
Int_t AuthExists(TString User, Int_t method, const char *Options, Int_t *Message, Int_t *Rflag, CheckSecCtx_t funcheck)
Check if we have a valid established sec context in memory Retrieves relevant info and negotiates wit...
 
static TList * GetAuthInfo()
Static method returning the list with authentication details.
 
static GlobusAuth_t GetGlobusAuthHook()
Static method returning the globus authorization hook (no longer supported)
 
Int_t ClearAuth(TString &user, TString &passwd, Bool_t &pwhash)
UsrPwd client authentication code.
 
static void AuthError(const char *where, Int_t error)
Print error string depending on error code.
 
static char * GetDefaultDetails(Int_t method, Int_t opt, const char *user)
Determine default authentication details for method 'sec' and user 'usr'.
 
static void MergeHostAuthList(TList *Std, TList *New, Option_t *Opt="")
Tool for updating fgAuthInfo 'nin' contains list of last input information through (re)reading of a r...
 
static TString fgDefaultUser
 
static Int_t GetAuthMethodIdx(const char *meth)
Static method returning the method index (which can be used to find the method in GetAuthMethod()).
 
static Int_t DecodeRSAPublic(const char *rsapubexport, R__rsa_NUMBER &n, R__rsa_NUMBER &d, char **rsassl=nullptr)
Store RSA public keys from export string rsaPubExport.
 
static void SetTimeOut(Int_t to)
Set timeout (active if > 0)
 
static Bool_t fgUsrPwdCrypt
 
TAuthenticate(TSocket *sock, const char *remote, const char *proto, const char *user="")
Create authentication object.
 
static void RemoveSecContext(TRootSecContext *ctx)
Tool for removing SecContext ctx from THostAuth listed in fgAuthInfo.
 
static TDatime GetGlobalExpDate()
Static method returning default expiring date for new validity contexts.
 
static Bool_t GetGlobalSRPPwd()
Static method returning the global SRP password flag.
 
static SecureAuth_t fgSecAuthHook
 
static char * PromptUser(const char *remote)
Static method to prompt for the user name to be used for authentication to rootd.
 
static Bool_t CheckHost(const char *Host, const char *host)
Check if 'host' matches 'href': this means either equal or "containing" it, even with wild cards * in...
 
static void SetDefaultRSAKeyType(Int_t key)
Static method setting the default type of RSA key.
 
static const char * GetAuthMethod(Int_t idx)
Static method returning the method corresponding to idx.
 
static Bool_t GetAuthReUse()
Static method returning the authentication reuse settings.
 
static THostAuth * HasHostAuth(const char *host, const char *user, Option_t *opt="R")
Checks if a THostAuth with exact match for {host,user} exists in the fgAuthInfo list Returns pointer ...
 
This class stores the date and time with a precision of one second in an unsigned 32 bit word (950130...
 
virtual Int_t GetValue(const char *name, Int_t dflt) const
Returns the integer value for a resource.
 
TRootSecContext * CreateSecContext(const char *user, const char *host, Int_t meth, Int_t offset, const char *details, const char *token, TDatime expdate=kROOTTZERO, void *ctx=nullptr, Int_t key=-1)
Create a Security context and add it to local list Return pointer to it to be stored in TAuthenticate...
 
const char * GetHost() const
 
void SetUser(const char *user)
 
void SetHost(const char *host)
 
void SetFirst(Int_t level)
Set 'method' to be the first used (if in the list ...).
 
void SetServer(Int_t server)
 
void RemoveMethod(Int_t level)
Remove method 'meth' from the list, if there ...
 
void CountFailure(Int_t level)
Count failures for 'method'.
 
void AddFirst(Int_t level, const char *details=nullptr)
Add new method in first position If already in the list, set as first method 'level' with authenticat...
 
Int_t GetMethod(Int_t idx) const
 
Bool_t HasMethod(Int_t level, Int_t *pos=nullptr)
Return kTRUE if method 'level' is in the list.
 
TList * Established() const
 
const char * GetDetails(Int_t level)
Return authentication details for specified level or "" if the specified level does not exist for thi...
 
void SetLast(Int_t level)
Set 'method' to be the last used (if in the list ...).
 
void CountSuccess(Int_t level)
Count successes for 'method'.
 
This class represents an Internet Protocol (IP) address.
 
void Add(TObject *obj) override
 
TObject * Remove(TObject *obj) override
Remove object from the list.
 
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
 
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
 
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
 
static const TString & GetEtcDir()
Get the sysconfig directory in the installation. Static utility function.
 
static RSA_encode_t RSA_encode()
 
static RSA_genprim_t RSA_genprim()
 
static RSA_assign_t RSA_assign()
 
static RSA_cmp_t RSA_cmp()
 
static RSA_decode_t RSA_decode()
 
static RSA_genrsa_t RSA_genrsa()
 
static RSA_num_sput_t RSA_num_sput()
 
static RSA_num_sget_t RSA_num_sget()
 
Regular expression class.
 
void Print(Option_t *option="F") const override
If opt is "F" (default) print object content.
 
Bool_t IsActive() const
Check remote OffSet and expiring Date.
 
const char * GetID() const
 
void AddForCleanup(Int_t port, Int_t proto, Int_t type)
Create a new TSecContextCleanup Internally is added to the list.
 
const char * GetUser() const
 
virtual Int_t Recv(TMessage *&mess)
Receive a TMessage object.
 
static Int_t GetClientProtocol()
Static method returning supported client protocol.
 
Int_t GetRemoteProtocol() const
 
virtual void Close(Option_t *opt="")
Close the socket.
 
virtual Int_t RecvRaw(void *buffer, Int_t length, ESendRecvOptions opt=kDefault)
Receive a raw buffer of specified length bytes.
 
virtual Int_t SendRaw(const void *buffer, Int_t length, ESendRecvOptions opt=kDefault)
Send a raw buffer of specified length.
 
Int_t GetServType() const
 
virtual Int_t Send(const TMessage &mess)
Send a TMessage object.
 
TString & Replace(Ssiz_t pos, Ssiz_t n, const char *s)
 
const char * Data() const
 
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
 
TString & Remove(Ssiz_t pos)
 
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
 
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
 
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
 
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
 
virtual FILE * TempFileName(TString &base, const char *dir=nullptr, const char *suffix=nullptr)
Create a secure temporary file by appending a unique 6 letter string to base.
 
virtual int GetPid()
Get process id.
 
virtual const char * Getenv(const char *env)
Get environment variable.
 
virtual char * ConcatFileName(const char *dir, const char *name)
Concatenate a directory and a file name.
 
virtual int Load(const char *module, const char *entry="", Bool_t system=kFALSE)
Load a shared library.
 
int GetPathInfo(const char *path, Long_t *id, Long_t *size, Long_t *flags, Long_t *modtime)
Get info about a file: id, size, flags, modification time.
 
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
 
virtual void DispatchOneEvent(Bool_t pendingOnly=kFALSE)
Dispatch a single event.
 
virtual const char * HostName()
Return the system's host name.
 
virtual Int_t GetEffectiveUid()
Returns the effective user id.
 
virtual TInetAddress GetHostByName(const char *server)
Get Internet Protocol (IP) address of host.
 
virtual const char * HomeDirectory(const char *userName=nullptr)
Return the user's home directory.
 
virtual int Unlink(const char *name)
Unlink, i.e.
 
virtual UserGroup_t * GetUserInfo(Int_t uid)
Returns all user info in the UserGroup_t structure.
 
char * DynamicPathName(const char *lib, Bool_t quiet=kFALSE)
Find a dynamic library called lib using the system search paths.
 
Handles synchronous and a-synchronous timer events.
 
This class implements a mutex interface.
 
void inv(rsa_NUMBER *, rsa_NUMBER *, rsa_NUMBER *)