xrootd
Main Page
Namespaces
Classes
Files
File List
File Members
src
XrdSecsss
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
//
38
struct
XrdSecsssRR_Hdr
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
//
51
struct
XrdSecsssRR_Data
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
) -
77
XrdSecsssRR_Data::DataSz
;
78
#endif
Generated by
1.8.3.1