forked from willamowius/gnugk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
authenticators.h
136 lines (103 loc) · 3.19 KB
/
authenticators.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
//////////////////////////////////////////////////////////////////
//
// authenticators.h
//
// Copyright (c) 2015, Jan Willamowius
//
// additional authentication modules
//
// This work is published under the GNU Public License version 2 (GPLv2)
// see file COPYING for details.
// We also explicitly grant the right to link this code
// with the OpenH323/H323Plus and OpenSSL library.
//
//////////////////////////////////////////////////////////////////
#ifndef AUTHENTICATORS_H
#define AUTHENTICATORS_H "@(#) $Id$"
#include <h235auth.h>
#include "config.h"
#ifdef HAS_DES_ECB
////////////////////////////////////////////////////
#include <h235/h235crypto.h>
/** This class implements desECB authentication.
*/
class H235AuthDesECB : public H235Authenticator
{
PCLASSINFO(H235AuthDesECB, H235Authenticator);
public:
H235AuthDesECB();
PObject * Clone() const;
virtual const char * GetName() const;
static PStringArray GetAuthenticatorNames();
#if PTLIB_VER >= 2110
static PBoolean GetAuthenticationCapabilities(Capabilities * ids);
#endif
virtual PBoolean IsMatch(const PString & identifier) const;
virtual H225_CryptoH323Token * CreateCryptoToken();
virtual ValidationResult ValidateCryptoToken(
const H225_CryptoH323Token & cryptoToken,
const PBYTEArray & rawPDU
);
virtual PBoolean IsCapability(
const H235_AuthenticationMechanism & mechansim,
const PASN_ObjectId & algorithmOID
);
virtual PBoolean SetCapability(
H225_ArrayOf_AuthenticationMechanism & mechansim,
H225_ArrayOf_PASN_ObjectId & algorithmOIDs
);
virtual PBoolean IsSecuredPDU(
unsigned rasPDU,
PBoolean received
) const;
virtual PBoolean IsSecuredSignalPDU(
unsigned rasPDU,
PBoolean received
) const;
};
#endif
#ifndef OFF
// This stub is enough to fake 2.16.840.1.114187.1.3 support.
// We don't know what the actual crypto is.
#if defined(H323_H235)
////////////////////////////////////////////////////
#include <h235/h235crypto.h>
/** This class implements desCTS authentication.
*/
class H235AuthDesCTS : public H235Authenticator
{
PCLASSINFO(H235AuthDesCTS, H235Authenticator);
public:
H235AuthDesCTS();
PObject * Clone() const;
virtual const char * GetName() const;
static PStringArray GetAuthenticatorNames();
#if PTLIB_VER >= 2110
static PBoolean GetAuthenticationCapabilities(Capabilities * ids);
#endif
virtual PBoolean IsMatch(const PString & identifier) const;
virtual H225_CryptoH323Token * CreateCryptoToken();
virtual ValidationResult ValidateCryptoToken(
const H225_CryptoH323Token & cryptoToken,
const PBYTEArray & rawPDU
);
virtual PBoolean IsCapability(
const H235_AuthenticationMechanism & mechansim,
const PASN_ObjectId & algorithmOID
);
virtual PBoolean SetCapability(
H225_ArrayOf_AuthenticationMechanism & mechansim,
H225_ArrayOf_PASN_ObjectId & algorithmOIDs
);
virtual PBoolean IsSecuredPDU(
unsigned rasPDU,
PBoolean received
) const;
virtual PBoolean IsSecuredSignalPDU(
unsigned rasPDU,
PBoolean received
) const;
};
#endif
#endif // OFF
#endif // AUTHENTICATORS_H