Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

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

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

153

154

155

156

157

158

159

160

161

162

163

164

165

166

167

168

169

170

171

172

173

174

175

176

177

178

179

180

181

182

183

184

185

186

187

188

189

190

191

192

193

194

195

196

197

198

199

200

201

202

203

204

205

206

207

208

209

210

211

212

213

214

215

216

217

218

219

220

221

222

223

224

225

226

227

228

229

230

231

232

233

234

235

236

237

238

239

240

241

242

243

244

245

246

247

248

249

250

251

252

253

254

255

256

257

258

259

260

261

262

263

264

265

266

267

268

269

270

271

272

273

274

275

276

277

278

279

280

281

282

283

284

285

286

287

288

289

290

291

292

293

294

295

296

297

298

299

300

301

302

303

304

305

306

307

308

309

310

311

312

313

314

315

316

317

318

319

320

321

322

323

324

325

326

327

328

329

330

331

332

333

334

335

336

337

338

339

340

341

342

343

344

345

346

347

348

349

350

351

352

353

354

355

356

357

358

359

360

361

362

363

364

365

366

367

368

369

370

371

372

373

374

375

376

377

378

379

380

381

382

383

384

385

386

387

388

389

390

391

392

393

394

395

396

397

398

399

400

401

402

403

404

405

406

407

408

409

410

411

412

413

414

415

416

417

418

419

420

421

422

423

424

425

426

427

428

429

430

431

432

433

434

435

436

437

438

439

440

441

442

443

444

445

446

447

448

449

450

451

452

453

454

455

456

457

458

459

460

461

462

463

464

465

466

467

468

469

470

471

472

473

474

475

476

477

478

479

480

481

482

483

484

485

486

487

488

489

490

491

492

493

494

495

496

497

498

499

500

501

502

503

504

# Copyright (c) 2013, Marc Horowitz 

# All rights reserved. 

# 

# Redistribution and use in source and binary forms, with or without 

# modification, are permitted provided that the following conditions are 

# met: 

# 

# Redistributions of source code must retain the above copyright notice, 

# this list of conditions and the following disclaimer. 

# 

# Redistributions in binary form must reproduce the above copyright 

# notice, this list of conditions and the following disclaimer in the 

# documentation and/or other materials provided with the distribution. 

# 

# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 

# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 

# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 

# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 

# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 

# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 

# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 

# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 

# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 

# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 

# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 

# 

# Altered source by Alberto Solino (@agsolino) 

# 

# Changed some of the classes names to match the RFC 4120 

# Added [MS-KILE] data 

# Adapted to Enum 

# 

 

 

from pyasn1.type import tag, namedtype, univ, constraint, char, useful 

 

from . import constants 

 

 

def _application_tag(tag_value): 

return univ.Sequence.tagSet.tagExplicitly( 

tag.Tag(tag.tagClassApplication, tag.tagFormatConstructed, 

int(tag_value))) 

 

def _vno_component(tag_value, name="pvno"): 

return _sequence_component( 

name, tag_value, univ.Integer(), 

subtypeSpec=constraint.ValueRangeConstraint(5, 5)) 

 

def _msg_type_component(tag_value, values): 

c = constraint.ConstraintsUnion( 

*(constraint.SingleValueConstraint(int(v)) for v in values)) 

return _sequence_component('msg-type', tag_value, univ.Integer(), 

subtypeSpec=c) 

 

def _sequence_component(name, tag_value, type, **subkwargs): 

return namedtype.NamedType(name, type.subtype( 

explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 

tag_value), 

**subkwargs)) 

 

def _sequence_optional_component(name, tag_value, type, **subkwargs): 

return namedtype.OptionalNamedType(name, type.subtype( 

explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 

tag_value), 

**subkwargs)) 

 

def seq_set(seq, name, builder=None, *args, **kwargs): 

component = seq.setComponentByName(name).getComponentByName(name) 

if builder is not None: 

seq.setComponentByName(name, builder(component, *args, **kwargs)) 

else: 

seq.setComponentByName(name) 

return seq.getComponentByName(name) 

 

def seq_set_dict(seq, name, pairs, *args, **kwargs): 

component = seq.setComponentByName(name).getComponentByName(name) 

for k, v in pairs.items(): 

component.setComponentByName(k, v) 

 

def seq_set_iter(seq, name, iterable): 

component = seq.setComponentByName(name).getComponentByName(name) 

for pos, v in enumerate(iterable): 

component.setComponentByPosition(pos, v) 

 

def seq_set_flags(seq, name, flags): 

seq_set(seq, name, flags.to_asn1) 

 

def seq_append(seq, name, pairs): 

component = seq.getComponentByName(name) 

if component is None: 

component = seq.setComponentByName(name).getComponentByName(name) 

index = len(component) 

element = component.setComponentByPosition(index 

).getComponentByPosition(index) 

for k, v in pairs.items(): 

element.setComponentByName(k, v) 

 

class Int32(univ.Integer): 

subtypeSpec = univ.Integer.subtypeSpec + constraint.ValueRangeConstraint( 

-2147483648, 2147483647) 

 

class UInt32(univ.Integer): 

pass 

# subtypeSpec = univ.Integer.subtypeSpec + constraint.ValueRangeConstraint( 

# 0, 4294967295) 

 

class Microseconds(univ.Integer): 

subtypeSpec = univ.Integer.subtypeSpec + constraint.ValueRangeConstraint( 

0, 999999) 

 

class KerberosString(char.GeneralString): 

# TODO marc: I'm not sure how to express this constraint in the API. 

# For now, we will be liberal in what we accept. 

# subtypeSpec = constraint.PermittedAlphabetConstraint(char.IA5String()) 

pass 

 

class Realm(KerberosString): 

pass 

 

class PrincipalName(univ.Sequence): 

componentType = namedtype.NamedTypes( 

_sequence_component("name-type", 0, Int32()), 

_sequence_component("name-string", 1, 

univ.SequenceOf(componentType=KerberosString())) 

) 

 

class KerberosTime(useful.GeneralizedTime): 

pass 

 

class HostAddress(univ.Sequence): 

componentType = namedtype.NamedTypes( 

_sequence_component("addr-type", 0, Int32()), 

_sequence_component("address", 1, univ.OctetString()) 

) 

 

class HostAddresses(univ.SequenceOf): 

componentType = HostAddress() 

 

class AuthorizationData(univ.SequenceOf): 

componentType = univ.Sequence(componentType=namedtype.NamedTypes( 

_sequence_component('ad-type', 0, Int32()), 

_sequence_component('ad-data', 1, univ.OctetString()) 

)) 

 

class PA_DATA(univ.Sequence): 

componentType = namedtype.NamedTypes( 

_sequence_component('padata-type', 1, Int32()), 

_sequence_component('padata-value', 2, univ.OctetString()) 

) 

 

class KerberosFlags(univ.BitString): 

# TODO marc: it doesn't look like there's any way to specify the 

# SIZE (32.. MAX) parameter to the encoder. However, we can 

# arrange at a higher layer to pass in >= 32 bits to the encoder. 

pass 

 

class EncryptedData(univ.Sequence): 

componentType = namedtype.NamedTypes( 

_sequence_component("etype", 0, Int32()), 

_sequence_optional_component("kvno", 1, UInt32()), 

_sequence_component("cipher", 2, univ.OctetString()) 

) 

 

class EncryptionKey(univ.Sequence): 

componentType = namedtype.NamedTypes( 

_sequence_component('keytype', 0, Int32()), 

_sequence_component('keyvalue', 1, univ.OctetString())) 

 

class Checksum(univ.Sequence): 

componentType = namedtype.NamedTypes( 

_sequence_component('cksumtype', 0, Int32()), 

_sequence_component('checksum', 1, univ.OctetString())) 

 

class Ticket(univ.Sequence): 

tagSet = _application_tag(constants.ApplicationTagNumbers.Ticket.value) 

componentType = namedtype.NamedTypes( 

_vno_component(name="tkt-vno", tag_value=0), 

_sequence_component("realm", 1, Realm()), 

_sequence_component("sname", 2, PrincipalName()), 

_sequence_component("enc-part", 3, EncryptedData()) 

) 

 

class TicketFlags(KerberosFlags): 

pass 

 

class TransitedEncoding(univ.Sequence): 

componentType = namedtype.NamedTypes( 

_sequence_component('tr-type', 0, Int32()), 

_sequence_component('contents', 1, univ.OctetString())) 

 

class EncTicketPart(univ.Sequence): 

tagSet = _application_tag(constants.ApplicationTagNumbers.EncTicketPart.value) 

componentType = namedtype.NamedTypes( 

_sequence_component("flags", 0, TicketFlags()), 

_sequence_component("key", 1, EncryptionKey()), 

_sequence_component("crealm", 2, Realm()), 

_sequence_component("cname", 3, PrincipalName()), 

_sequence_component("transited", 4, TransitedEncoding()), 

_sequence_component("authtime", 5, KerberosTime()), 

_sequence_optional_component("starttime", 6, KerberosTime()), 

_sequence_component("endtime", 7, KerberosTime()), 

_sequence_optional_component("renew-till", 8, KerberosTime()), 

_sequence_optional_component("caddr", 9, HostAddresses()), 

_sequence_optional_component("authorization-data", 10, AuthorizationData()) 

) 

 

class KDCOptions(KerberosFlags): 

pass 

 

class KDC_REQ_BODY(univ.Sequence): 

componentType = namedtype.NamedTypes( 

_sequence_component('kdc-options', 0, KDCOptions()), 

_sequence_optional_component('cname', 1, PrincipalName()), 

_sequence_component('realm', 2, Realm()), 

_sequence_optional_component('sname', 3, PrincipalName()), 

_sequence_optional_component('from', 4, KerberosTime()), 

_sequence_component('till', 5, KerberosTime()), 

_sequence_optional_component('rtime', 6, KerberosTime()), 

_sequence_component('nonce', 7, UInt32()), 

_sequence_component('etype', 8, 

univ.SequenceOf(componentType=Int32())), 

_sequence_optional_component('addresses', 9, HostAddresses()), 

_sequence_optional_component('enc-authorization-data', 10, 

EncryptedData()), 

_sequence_optional_component('additional-tickets', 11, 

univ.SequenceOf(componentType=Ticket())) 

) 

 

class KDC_REQ(univ.Sequence): 

componentType = namedtype.NamedTypes( 

_vno_component(1), 

_msg_type_component(2, (constants.ApplicationTagNumbers.AS_REQ.value, 

constants.ApplicationTagNumbers.TGS_REQ.value)), 

_sequence_optional_component('padata', 3, 

univ.SequenceOf(componentType=PA_DATA())), 

_sequence_component('req-body', 4, KDC_REQ_BODY()) 

) 

 

class AS_REQ(KDC_REQ): 

tagSet = _application_tag(constants.ApplicationTagNumbers.AS_REQ.value) 

 

class TGS_REQ(KDC_REQ): 

tagSet = _application_tag(constants.ApplicationTagNumbers.TGS_REQ.value) 

 

class KDC_REP(univ.Sequence): 

componentType = namedtype.NamedTypes( 

_vno_component(0), 

_msg_type_component(1, (constants.ApplicationTagNumbers.AS_REP.value, 

constants.ApplicationTagNumbers.TGS_REP.value)), 

_sequence_optional_component('padata', 2, 

univ.SequenceOf(componentType=PA_DATA())), 

_sequence_component('crealm', 3, Realm()), 

_sequence_component('cname', 4, PrincipalName()), 

_sequence_component('ticket', 5, Ticket()), 

_sequence_component('enc-part', 6, EncryptedData()) 

) 

 

class LastReq(univ.SequenceOf): 

componentType = univ.Sequence(componentType=namedtype.NamedTypes( 

_sequence_component('lr-type', 0, Int32()), 

_sequence_component('lr-value', 1, KerberosTime()) 

)) 

 

class METHOD_DATA(univ.SequenceOf): 

componentType = PA_DATA() 

 

class EncKDCRepPart(univ.Sequence): 

componentType = namedtype.NamedTypes( 

_sequence_component('key', 0, EncryptionKey()), 

_sequence_component('last-req', 1, LastReq()), 

_sequence_component('nonce', 2, UInt32()), 

_sequence_optional_component('key-expiration', 3, KerberosTime()), 

_sequence_component('flags', 4, TicketFlags()), 

_sequence_component('authtime', 5, KerberosTime()), 

_sequence_optional_component('starttime', 6, KerberosTime()), 

_sequence_component('endtime', 7, KerberosTime()), 

_sequence_optional_component('renew-till', 8, KerberosTime()), 

_sequence_component('srealm', 9, Realm()), 

_sequence_component('sname', 10, PrincipalName()), 

_sequence_optional_component('caddr', 11, HostAddresses()), 

_sequence_optional_component('encrypted_pa_data', 12, METHOD_DATA()) 

) 

 

class EncASRepPart(EncKDCRepPart): 

tagSet = _application_tag(constants.ApplicationTagNumbers.EncASRepPart.value) 

 

class EncTGSRepPart(EncKDCRepPart): 

tagSet = _application_tag(constants.ApplicationTagNumbers.EncTGSRepPart.value) 

 

class AS_REP(KDC_REP): 

tagSet = _application_tag(constants.ApplicationTagNumbers.AS_REP.value) 

 

class TGS_REP(KDC_REP): 

tagSet = _application_tag(constants.ApplicationTagNumbers.TGS_REP.value) 

 

class APOptions(KerberosFlags): 

pass 

 

class Authenticator(univ.Sequence): 

tagSet = _application_tag(constants.ApplicationTagNumbers.Authenticator.value) 

componentType = namedtype.NamedTypes( 

_vno_component(name='authenticator-vno', tag_value=0), 

_sequence_component('crealm', 1, Realm()), 

_sequence_component('cname', 2, PrincipalName()), 

_sequence_optional_component('cksum', 3, Checksum()), 

_sequence_component('cusec', 4, Microseconds()), 

_sequence_component('ctime', 5, KerberosTime()), 

_sequence_optional_component('subkey', 6, EncryptionKey()), 

_sequence_optional_component('seq-number', 7, UInt32()), 

_sequence_optional_component('authorization-data', 8, 

AuthorizationData()) 

) 

 

class AP_REQ(univ.Sequence): 

tagSet = _application_tag(constants.ApplicationTagNumbers.AP_REQ.value) 

componentType = namedtype.NamedTypes( 

_vno_component(0), 

_msg_type_component(1, (constants.ApplicationTagNumbers.AP_REQ.value,)), 

_sequence_component('ap-options', 2, APOptions()), 

_sequence_component('ticket', 3, Ticket()), 

_sequence_component('authenticator', 4, EncryptedData()) 

) 

 

class AP_REP(univ.Sequence): 

tagSet = _application_tag(constants.ApplicationTagNumbers.AP_REP.value) 

componentType = namedtype.NamedTypes( 

_vno_component(0), 

_msg_type_component(1, (constants.ApplicationTagNumbers.AP_REP.value,)), 

_sequence_component('enc-part', 2, EncryptedData()), 

) 

 

class EncAPRepPart(univ.Sequence): 

tagSet = _application_tag(constants.ApplicationTagNumbers.EncApRepPart.value) 

componentType = namedtype.NamedTypes( 

_sequence_component('ctime', 0, KerberosTime()), 

_sequence_component('cusec', 1, Microseconds()), 

_sequence_optional_component('subkey', 2, EncryptionKey()), 

_sequence_optional_component('seq-number', 3, UInt32()), 

) 

 

class KRB_SAFE_BODY(univ.Sequence): 

componentType = namedtype.NamedTypes( 

_sequence_component('user-data', 0, univ.OctetString()), 

_sequence_optional_component('timestamp', 1, KerberosTime()), 

_sequence_optional_component('usec', 2, Microseconds()), 

_sequence_optional_component('seq-number', 3, UInt32()), 

_sequence_component('s-address', 4, HostAddress()), 

_sequence_optional_component('r-address', 5, HostAddress()), 

) 

 

class KRB_SAFE(univ.Sequence): 

tagSet = _application_tag(constants.ApplicationTagNumbers.KRB_SAFE.value) 

componentType = namedtype.NamedTypes( 

_vno_component(0), 

_msg_type_component(1, (constants.ApplicationTagNumbers.KRB_SAFE.value,)), 

_sequence_component('safe-body', 2, KRB_SAFE_BODY()), 

_sequence_component('cksum', 3, Checksum()), 

) 

 

class KRB_PRIV(univ.Sequence): 

tagSet = _application_tag(constants.ApplicationTagNumbers.KRB_PRIV.value) 

componentType = namedtype.NamedTypes( 

_vno_component(0), 

_msg_type_component(1, (constants.ApplicationTagNumbers.KRB_PRIV.value,)), 

_sequence_component('enc-part', 3, EncryptedData()), 

) 

 

class EncKrbPrivPart(univ.Sequence): 

tagSet = _application_tag(constants.ApplicationTagNumbers.EncKrbPrivPart.value) 

componentType = namedtype.NamedTypes( 

_sequence_component('user-data', 0, univ.OctetString()), 

_sequence_optional_component('timestamp', 1, KerberosTime()), 

_sequence_optional_component('cusec', 2, Microseconds()), 

_sequence_optional_component('seq-number', 3, UInt32()), 

_sequence_component('s-address', 4, HostAddress()), 

_sequence_optional_component('r-address', 5, HostAddress()), 

) 

 

class KRB_CRED(univ.Sequence): 

tagSet = _application_tag(constants.ApplicationTagNumbers.KRB_CRED.value) 

componentType = namedtype.NamedTypes( 

_vno_component(0), 

_msg_type_component(1, (constants.ApplicationTagNumbers.KRB_CRED.value,)), 

_sequence_optional_component('tickets', 2, 

univ.SequenceOf(componentType=Ticket())), 

_sequence_component('enc-part', 3, EncryptedData()), 

) 

 

class KrbCredInfo(univ.Sequence): 

componentType = namedtype.NamedTypes( 

_sequence_component('key', 0, EncryptionKey()), 

_sequence_optional_component('prealm', 1, Realm()), 

_sequence_optional_component('pname', 2, PrincipalName()), 

_sequence_optional_component('flags', 3, TicketFlags()), 

_sequence_optional_component('authtime', 4, KerberosTime()), 

_sequence_optional_component('starttime', 5, KerberosTime()), 

_sequence_optional_component('endtime', 6, KerberosTime()), 

_sequence_optional_component('renew-till', 7, KerberosTime()), 

_sequence_optional_component('srealm', 8, Realm()), 

_sequence_optional_component('sname', 9, PrincipalName()), 

_sequence_optional_component('caddr', 10, HostAddresses()), 

) 

 

class EncKrbCredPart(univ.Sequence): 

tagSet = _application_tag(constants.ApplicationTagNumbers.EncKrbCredPart.value) 

componentType = namedtype.NamedTypes( 

_sequence_component('ticket-info', 0, univ.SequenceOf(componentType=KrbCredInfo())), 

_sequence_optional_component('nonce', 1, UInt32()), 

_sequence_optional_component('timestamp', 2, KerberosTime()), 

_sequence_optional_component('usec', 3, Microseconds()), 

_sequence_optional_component('s-address', 4, HostAddress()), 

_sequence_optional_component('r-address', 5, HostAddress()), 

) 

 

class KRB_ERROR(univ.Sequence): 

tagSet = _application_tag(constants.ApplicationTagNumbers.KRB_ERROR.value) 

componentType = namedtype.NamedTypes( 

_vno_component(0), 

_msg_type_component(1, (constants.ApplicationTagNumbers.KRB_ERROR.value,)), 

_sequence_optional_component('ctime', 2, KerberosTime()), 

_sequence_optional_component('cusec', 3, Microseconds()), 

_sequence_component('stime', 4, KerberosTime()), 

_sequence_component('susec', 5, Microseconds()), 

_sequence_component('error-code', 6, Int32()), 

_sequence_optional_component('crealm', 7, Realm()), 

_sequence_optional_component('cname', 8, PrincipalName()), 

_sequence_component('realm', 9, Realm()), 

_sequence_component('sname', 10, PrincipalName()), 

_sequence_optional_component('e-text', 11, KerberosString()), 

_sequence_optional_component('e-data', 12, univ.OctetString()) 

) 

 

class TYPED_DATA(univ.SequenceOf): 

componentType = namedtype.NamedTypes( 

_sequence_component('data-type', 0, Int32()), 

_sequence_optional_component('data-value', 1, univ.OctetString()), 

) 

 

class PA_ENC_TIMESTAMP(EncryptedData): 

pass 

 

class PA_ENC_TS_ENC(univ.Sequence): 

componentType = namedtype.NamedTypes( 

_sequence_component('patimestamp', 0, KerberosTime()), 

_sequence_optional_component('pausec', 1, Microseconds())) 

 

class ETYPE_INFO_ENTRY(univ.Sequence): 

componentType = namedtype.NamedTypes( 

_sequence_component('etype', 0, Int32()), 

_sequence_optional_component('salt', 1, univ.OctetString())) 

 

class ETYPE_INFO(univ.SequenceOf): 

componentType = ETYPE_INFO_ENTRY() 

 

class ETYPE_INFO2_ENTRY(univ.Sequence): 

componentType = namedtype.NamedTypes( 

_sequence_component('etype', 0, Int32()), 

_sequence_optional_component('salt', 1, KerberosString()), 

_sequence_optional_component('s2kparams', 2, univ.OctetString())) 

 

class ETYPE_INFO2(univ.SequenceOf): 

componentType = ETYPE_INFO2_ENTRY() 

 

class AD_IF_RELEVANT(AuthorizationData): 

pass 

 

class AD_KDCIssued(univ.Sequence): 

componentType = namedtype.NamedTypes( 

_sequence_component('ad-checksum', 0, Checksum()), 

_sequence_optional_component('i-realm', 1, Realm()), 

_sequence_optional_component('i-sname', 2, PrincipalName()), 

_sequence_component('elements', 3, AuthorizationData())) 

 

class AD_AND_OR(univ.Sequence): 

componentType = namedtype.NamedTypes( 

_sequence_component('condition-count', 0, Int32()), 

_sequence_optional_component('elements', 1, AuthorizationData())) 

 

class AD_MANDATORY_FOR_KDC(AuthorizationData): 

pass 

 

class KERB_PA_PAC_REQUEST(univ.Sequence): 

componentType = namedtype.NamedTypes( 

namedtype.NamedType('include-pac', univ.Boolean().subtype(explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0))), 

) 

 

class PA_FOR_USER_ENC(univ.Sequence): 

componentType = namedtype.NamedTypes( 

_sequence_component('userName', 0, PrincipalName()), 

_sequence_optional_component('userRealm', 1, Realm()), 

_sequence_optional_component('cksum', 2, Checksum()), 

_sequence_optional_component('auth-package', 3, KerberosString())) 

 

class KERB_ERROR_DATA(univ.Sequence): 

componentType = namedtype.NamedTypes( 

_sequence_component('data-type', 1, Int32()), 

_sequence_component('data-value', 2, univ.OctetString())) 

 

class PA_PAC_OPTIONS(univ.Sequence): 

componentType = namedtype.NamedTypes( 

_sequence_component('flags', 0, KerberosFlags()), 

)