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