xrootd
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 <string.h>
34 #include <time.h>
35 
36 // The following is the packet header and is always unencrypted.
37 //
39 {
40 char ProtID[4]; // Protocol ID ("sss")
41 char Pad[3]; // Padding bytes
42 char EncType; // Encryption type as one of:
43 static const char etBFish32 = '0'; // Blowfish
44 
45 long long KeyID; // Key ID for encryption
46 };
47 
48 // The data portion of the packet is encrypted with the private shared key
49 // It immediately follows the header and has a maximum size (defined here).
50 //
52 {
53 char Rand[32]; // 256-bit random string (avoid text attacks)
54 int GenTime; // Time data generated (time(0) - BaseTime)
55 char Pad[3]; // Reserved
56 char Options; // One of the following:
57 static const char UseData= 0x00; // Use the ID data as authenticated name
58 static const char SndLID = 0x01; // Server to send login ID
59 
60 static const int DataSz = 4040;
61 char Data[DataSz]; // Optional data, as follows:
62 
63 // (<Flag><packed null terminated string>)+
64 //
65 static const char theName = 0x01;
66 static const char theVorg = 0x02;
67 static const char theRole = 0x03;
68 static const char theGrps = 0x04;
69 static const char theEndo = 0x05;
70 // theCert = 0x06; // Reserved for future use
71 static const char theRand = 0x07; // Random string (ignored)
72 static const char theLgid = 0x10; // from server only
73 static const char theHost = 0x20; // from client only (required)
74 };
75 
76 static const int XrdSecsssRR_Data_HdrLen = sizeof(XrdSecsssRR_Data) -
78 #endif
XrdSecsssRR_Data::Options
char Options
Definition: XrdSecsssRR.hh:56
XrdSecsssRR_Data::theLgid
static const char theLgid
Definition: XrdSecsssRR.hh:72
XrdSecsssRR_Hdr::etBFish32
static const char etBFish32
Definition: XrdSecsssRR.hh:43
XrdSecsssRR_Data::theVorg
static const char theVorg
Definition: XrdSecsssRR.hh:66
XrdSecsssRR_Hdr
Definition: XrdSecsssRR.hh:39
XrdSecsssRR_Data::theRand
static const char theRand
Definition: XrdSecsssRR.hh:71
XrdSecsssRR_Data::DataSz
static const int DataSz
Definition: XrdSecsssRR.hh:60
XrdSecsssRR_Hdr::KeyID
long long KeyID
Definition: XrdSecsssRR.hh:45
XrdSecsssRR_Hdr::Pad
char Pad[3]
Definition: XrdSecsssRR.hh:41
XrdSecsssRR_Data
Definition: XrdSecsssRR.hh:52
XrdSecsssRR_Data::UseData
static const char UseData
Definition: XrdSecsssRR.hh:57
XrdSecsssRR_Data::GenTime
int GenTime
Definition: XrdSecsssRR.hh:54
XrdSecsssRR_Data_HdrLen
static const int XrdSecsssRR_Data_HdrLen
Definition: XrdSecsssRR.hh:76
XrdSecsssRR_Data::Data
char Data[DataSz]
Definition: XrdSecsssRR.hh:61
XrdSecsssRR_Data::theName
static const char theName
Definition: XrdSecsssRR.hh:65
XrdSecsssRR_Data::theGrps
static const char theGrps
Definition: XrdSecsssRR.hh:68
XrdSecsssRR_Hdr::ProtID
char ProtID[4]
Definition: XrdSecsssRR.hh:40
XrdSecsssRR_Data::theHost
static const char theHost
Definition: XrdSecsssRR.hh:73
XrdSecsssRR_Data::theEndo
static const char theEndo
Definition: XrdSecsssRR.hh:69
XrdSecsssRR_Data::Rand
char Rand[32]
Definition: XrdSecsssRR.hh:53
XrdSecsssRR_Hdr::EncType
char EncType
Definition: XrdSecsssRR.hh:42
XrdSecsssRR_Data::theRole
static const char theRole
Definition: XrdSecsssRR.hh:67
XrdSecsssRR_Data::Pad
char Pad[3]
Definition: XrdSecsssRR.hh:55
XrdSecsssRR_Data::SndLID
static const char SndLID
Definition: XrdSecsssRR.hh:58