xrootd
Loading...
Searching...
No Matches
XrdSecsssRR.hh
Go to the documentation of this file.
1#ifndef __SecsssRR__
2#define __SecsssRR__
3/******************************************************************************/
4/* */
5/* X r d S e c s s s R R . h h */
6/* */
7/* (c) 2008 by the Board of Trustees of the Leland Stanford, Jr., University */
8/* All Rights Reserved */
9/* Produced by Andrew Hanushevsky for Stanford University under contract */
10/* DE-AC02-76-SFO0515 with the Department of Energy */
11/* */
12/* This file is part of the XRootD software suite. */
13/* */
14/* XRootD is free software: you can redistribute it and/or modify it under */
15/* the terms of the GNU Lesser General Public License as published by the */
16/* Free Software Foundation, either version 3 of the License, or (at your */
17/* option) any later version. */
18/* */
19/* XRootD is distributed in the hope that it will be useful, but WITHOUT */
20/* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
21/* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */
22/* License for more details. */
23/* */
24/* You should have received a copy of the GNU Lesser General Public License */
25/* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */
26/* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */
27/* */
28/* The copyright holder's institutional names and contributor's names may not */
29/* be used to endorse or promote products derived from this software without */
30/* specific prior written permission of the institution or contributor. */
31/******************************************************************************/
32
33#include <cstdint>
34#include <cstring>
35#include <ctime>
36
38
39// The following is the packet header and is always unencrypted.
40//
42{
43char ProtID[4]; // Protocol ID ("sss")
44char Pad[2]; // Padding bytes
45uint8_t knSize; // Appended keyname size w/ null byte
46char EncType; // Encryption type as one of:
47static const char etBFish32 = '0'; // Blowfish
48
49long long KeyID; // Key ID for encryption
50};
51
52// Following this struct extends the original V1 struct with the keyname. V2
53// clients send the extended header to v2 servers. It must be a multiple of
54// 8 bytes and end with a null byte. Keynames have a maximum size as defined
55// in XrdSecsssKT. The keyname qualifies the lookup of the KeyID.
56//
61
62// The data portion of the packet is encrypted with the private shared key
63// It immediately follows the header and has a maximum size (defined here).
64//
66{
67char Rand[32]; // 256-bit random string (avoid text attacks)
68int GenTime; // Time data generated (time(0) - BaseTime)
69char Pad[3]; // Reserved
70char Options; // One of the following:
71static const char UseData= 0x00; // Use the ID data as authenticated name
72static const char SndLID = 0x01; // Server to send login ID
73static const char Ask4Mor= 0x02; // Ask for additional data (future)
74// Note: A variable length data portion follows the header
75};
76
78
80{
81static const int MaxCSz = 2048; // Maximum size of returned credentials
82static const int MaxDSz =16344; // Maximum size of v2 inline data
83static const int MinDSz = 128; // Minimum size for the data segment
84static const int DataSz = 4040; // Maximum size of V1 inline data
85char Data[DataSz]; // Optional V1 data (only for back compat)
86
87// (<Flag><packed null terminated string>)+
88//
89static const char theName = 0x01; // V1 and V2
90static const char theVorg = 0x02; // V1 and V2
91static const char theRole = 0x03; // V1 and V2
92static const char theGrps = 0x04; // V1 and V2
93static const char theEndo = 0x05; // V1 and V2
94static const char theCred = 0x06; // V2: Actual credentials
95static const char theRand = 0x07; // V1 and V2: Random string (ignored)
96
97static const char theAuth = 0x08; // V2: original authentication protocol
98static const char theTID = 0x09; // V2: The trace ID
99static const char theAKey = 0x0a; // V2: attribute key
100static const char theAVal = 0x0b; // V2: attribute value for preceding key
101static const char theUser = 0x0c; // V2: the Unix user name (original)
102static const char theGrup = 0x0d; // V2: the Unix group name (original)
103static const char theCaps = 0x0e; // V2: the x509 capabilities
104
105static const char theLgid = 0x10; // from server only
106static const char theHost = 0x20; // from client only (required)
107};
108
109// Struct used to effect a short response from the server
110//
115#endif
static const int XrdSecsssRR_Data_HdrLen
Definition XrdSecsssRR.hh:77
static const int NameSZ
Definition XrdSecsssKT.hh:49
Definition XrdSecsssRR.hh:66
static const char Ask4Mor
Definition XrdSecsssRR.hh:73
char Pad[3]
Definition XrdSecsssRR.hh:69
int GenTime
Definition XrdSecsssRR.hh:68
char Options
Definition XrdSecsssRR.hh:70
static const char SndLID
Definition XrdSecsssRR.hh:72
char Rand[32]
Definition XrdSecsssRR.hh:67
static const char UseData
Definition XrdSecsssRR.hh:71
Definition XrdSecsssRR.hh:112
char Data[XrdSecsssRR_Data::MinDSz+16]
Definition XrdSecsssRR.hh:113
Definition XrdSecsssRR.hh:80
static const char theHost
Definition XrdSecsssRR.hh:106
static const int MaxCSz
Definition XrdSecsssRR.hh:81
static const char theUser
Definition XrdSecsssRR.hh:101
static const char theAKey
Definition XrdSecsssRR.hh:99
static const char theCaps
Definition XrdSecsssRR.hh:103
char Data[DataSz]
Definition XrdSecsssRR.hh:85
static const char theAuth
Definition XrdSecsssRR.hh:97
static const char theRole
Definition XrdSecsssRR.hh:91
static const char theName
Definition XrdSecsssRR.hh:89
static const int MinDSz
Definition XrdSecsssRR.hh:83
static const int DataSz
Definition XrdSecsssRR.hh:84
static const char theLgid
Definition XrdSecsssRR.hh:105
static const char theGrps
Definition XrdSecsssRR.hh:92
static const char theRand
Definition XrdSecsssRR.hh:95
static const char theEndo
Definition XrdSecsssRR.hh:93
static const char theAVal
Definition XrdSecsssRR.hh:100
static const char theVorg
Definition XrdSecsssRR.hh:90
static const char theGrup
Definition XrdSecsssRR.hh:102
static const char theTID
Definition XrdSecsssRR.hh:98
static const int MaxDSz
Definition XrdSecsssRR.hh:82
static const char theCred
Definition XrdSecsssRR.hh:94
Definition XrdSecsssRR.hh:58
char keyName[XrdSecsssKT::ktEnt::NameSZ]
Definition XrdSecsssRR.hh:59
Definition XrdSecsssRR.hh:42
long long KeyID
Definition XrdSecsssRR.hh:49
uint8_t knSize
Definition XrdSecsssRR.hh:45
char EncType
Definition XrdSecsssRR.hh:46
char ProtID[4]
Definition XrdSecsssRR.hh:43
static const char etBFish32
Definition XrdSecsssRR.hh:47
char Pad[2]
Definition XrdSecsssRR.hh:44