Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/src/java.security.jgss/share/classes/sun/security/jgss/krb5/MessageToken.java
41161 views
1
/*
2
* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
*
5
* This code is free software; you can redistribute it and/or modify it
6
* under the terms of the GNU General Public License version 2 only, as
7
* published by the Free Software Foundation. Oracle designates this
8
* particular file as subject to the "Classpath" exception as provided
9
* by Oracle in the LICENSE file that accompanied this code.
10
*
11
* This code is distributed in the hope that it will be useful, but WITHOUT
12
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14
* version 2 for more details (a copy is included in the LICENSE file that
15
* accompanied this code).
16
*
17
* You should have received a copy of the GNU General Public License version
18
* 2 along with this work; if not, write to the Free Software Foundation,
19
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20
*
21
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22
* or visit www.oracle.com if you need additional information or have any
23
* questions.
24
*/
25
26
package sun.security.jgss.krb5;
27
28
import org.ietf.jgss.*;
29
import sun.security.jgss.*;
30
import java.io.InputStream;
31
import java.io.OutputStream;
32
import java.io.IOException;
33
import java.io.ByteArrayInputStream;
34
import java.security.MessageDigest;
35
36
/**
37
* This class is a base class for other token definitions that pertain to
38
* per-message GSS-API calls. Conceptually GSS-API has two types of
39
* per-message tokens: WrapToken and MicToken. They differ in the respect
40
* that a WrapToken carries additional plaintext or ciphertext application
41
* data besides just the sequence number and checksum. This class
42
* encapsulates the commonality in the structure of the WrapToken and the
43
* MicToken. This structure can be represented as:
44
* <p>
45
* <pre>
46
* 0..1 TOK_ID Identification field.
47
* 01 01 - Mic token
48
* 02 01 - Wrap token
49
* 2..3 SGN_ALG Checksum algorithm indicator.
50
* 00 00 - DES MAC MD5
51
* 01 00 - MD2.5
52
* 02 00 - DES MAC
53
* 04 00 - HMAC SHA1 DES3-KD
54
* 11 00 - RC4-HMAC
55
* 4..5 SEAL_ALG ff ff - none
56
* 00 00 - DES
57
* 02 00 - DES3-KD
58
* 10 00 - RC4-HMAC
59
* 6..7 Filler Contains ff ff
60
* 8..15 SND_SEQ Encrypted sequence number field.
61
* 16..s+15 SGN_CKSUM Checksum of plaintext padded data,
62
* calculated according to algorithm
63
* specified in SGN_ALG field.
64
* s+16..last Data encrypted or plaintext padded data
65
* </pre>
66
* Where "s" indicates the size of the checksum.
67
* <p>
68
* As always, this is preceeded by a GSSHeader.
69
*
70
* @author Mayank Upadhyay
71
* @author Ram Marti
72
* @see sun.security.jgss.GSSHeader
73
*/
74
75
abstract class MessageToken extends Krb5Token {
76
/* Fields in header minus checksum size */
77
private static final int TOKEN_NO_CKSUM_SIZE = 16;
78
79
/**
80
* Filler data as defined in the specification of the Kerberos v5 GSS-API
81
* Mechanism.
82
*/
83
private static final int FILLER = 0xffff;
84
85
// Signing algorithm values (for the SNG_ALG field)
86
87
// From RFC 1964
88
/* Use a DES MAC MD5 checksum */
89
static final int SGN_ALG_DES_MAC_MD5 = 0x0000;
90
91
/* Use DES MAC checksum. */
92
static final int SGN_ALG_DES_MAC = 0x0200;
93
94
// From draft-raeburn-cat-gssapi-krb5-3des-00
95
/* Use a HMAC SHA1 DES3 -KD checksum */
96
static final int SGN_ALG_HMAC_SHA1_DES3_KD = 0x0400;
97
98
// Sealing algorithm values (for the SEAL_ALG field)
99
100
// RFC 1964
101
/**
102
* A value for the SEAL_ALG field that indicates that no encryption was
103
* used.
104
*/
105
static final int SEAL_ALG_NONE = 0xffff;
106
/* Use DES CBC encryption algorithm. */
107
static final int SEAL_ALG_DES = 0x0000;
108
109
// From draft-raeburn-cat-gssapi-krb5-3des-00
110
/**
111
* Use DES3-KD sealing algorithm. (draft-raeburn-cat-gssapi-krb5-3des-00)
112
* This algorithm uses triple-DES with key derivation, with a usage
113
* value KG_USAGE_SEAL. Padding is still to 8-byte multiples, and the
114
* IV for encrypting application data is zero.
115
*/
116
static final int SEAL_ALG_DES3_KD = 0x0200;
117
118
// draft draft-brezak-win2k-krb-rc4-hmac-04.txt
119
static final int SEAL_ALG_ARCFOUR_HMAC = 0x1000;
120
static final int SGN_ALG_HMAC_MD5_ARCFOUR = 0x1100;
121
122
private static final int TOKEN_ID_POS = 0;
123
private static final int SIGN_ALG_POS = 2;
124
private static final int SEAL_ALG_POS = 4;
125
126
private int seqNumber;
127
128
private boolean confState = true;
129
private boolean initiator = true;
130
131
private int tokenId = 0;
132
private GSSHeader gssHeader = null;
133
private MessageTokenHeader tokenHeader = null;
134
private byte[] checksum = null;
135
private byte[] encSeqNumber = null;
136
private byte[] seqNumberData = null;
137
138
/* cipher instance used by the corresponding GSSContext */
139
CipherHelper cipherHelper = null;
140
141
142
/**
143
* Constructs a MessageToken from a byte array. If there are more bytes
144
* in the array than needed, the extra bytes are simply ignroed.
145
*
146
* @param tokenId the token id that should be contained in this token as
147
* it is read.
148
* @param context the Kerberos context associated with this token
149
* @param tokenBytes the byte array containing the token
150
* @param tokenOffset the offset where the token begins
151
* @param tokenLen the length of the token
152
* @param prop the MessageProp structure in which the properties of the
153
* token should be stored.
154
* @throws GSSException if there is a problem parsing the token
155
*/
156
MessageToken(int tokenId, Krb5Context context,
157
byte[] tokenBytes, int tokenOffset, int tokenLen,
158
MessageProp prop) throws GSSException {
159
this(tokenId, context,
160
new ByteArrayInputStream(tokenBytes, tokenOffset, tokenLen),
161
prop);
162
}
163
164
/**
165
* Constructs a MessageToken from an InputStream. Bytes will be read on
166
* demand and the thread might block if there are not enough bytes to
167
* complete the token.
168
*
169
* @param tokenId the token id that should be contained in this token as
170
* it is read.
171
* @param context the Kerberos context associated with this token
172
* @param is the InputStream from which to read
173
* @param prop the MessageProp structure in which the properties of the
174
* token should be stored.
175
* @throws GSSException if there is a problem reading from the
176
* InputStream or parsing the token
177
*/
178
MessageToken(int tokenId, Krb5Context context, InputStream is,
179
MessageProp prop) throws GSSException {
180
init(tokenId, context);
181
182
try {
183
gssHeader = new GSSHeader(is);
184
185
if (!gssHeader.getOid().equals(OID)) {
186
throw new GSSException(GSSException.DEFECTIVE_TOKEN, -1,
187
getTokenName(tokenId));
188
}
189
if (!confState) {
190
prop.setPrivacy(false);
191
}
192
193
tokenHeader = new MessageTokenHeader(is, prop);
194
195
encSeqNumber = new byte[8];
196
readFully(is, encSeqNumber);
197
198
// debug("\n\tRead EncSeq#=" +
199
// getHexBytes(encSeqNumber, encSeqNumber.length));
200
201
checksum = new byte[cipherHelper.getChecksumLength()];
202
readFully(is, checksum);
203
204
// debug("\n\tRead checksum=" +
205
// getHexBytes(checksum, checksum.length));
206
// debug("\nLeaving MessageToken.Cons\n");
207
208
} catch (IOException e) {
209
throw new GSSException(GSSException.DEFECTIVE_TOKEN, -1,
210
getTokenName(tokenId) + ":" + e.getMessage());
211
}
212
}
213
214
/**
215
* Used to obtain the GSSHeader that was at the start of this
216
* token.
217
*/
218
public final GSSHeader getGSSHeader() {
219
return gssHeader;
220
}
221
222
/**
223
* Used to obtain the token id that was contained in this token.
224
* @return the token id in the token
225
*/
226
public final int getTokenId() {
227
return tokenId;
228
}
229
230
/**
231
* Used to obtain the encrypted sequence number in this token.
232
* @return the encrypted sequence number in the token
233
*/
234
public final byte[] getEncSeqNumber() {
235
return encSeqNumber;
236
}
237
238
/**
239
* Used to obtain the checksum that was contained in this token.
240
* @return the checksum in the token
241
*/
242
public final byte[] getChecksum() {
243
return checksum;
244
}
245
246
/**
247
* Used to determine if this token contains any encrypted data.
248
* @return true if it contains any encrypted data, false if there is only
249
* plaintext data or if there is no data.
250
*/
251
public final boolean getConfState() {
252
return confState;
253
}
254
255
/**
256
* Generates the checksum field and the encrypted sequence number
257
* field. The encrypted sequence number uses the 8 bytes of the checksum
258
* as an initial vector in a fixed DesCbc algorithm.
259
*
260
* @param prop the MessageProp structure that determines what sort of
261
* checksum and sealing algorithm should be used. The lower byte
262
* of qop determines the checksum algorithm while the upper byte
263
* determines the signing algorithm.
264
* Checksum values are:
265
* 0 - default (DES_MAC)
266
* 1 - MD5
267
* 2 - DES_MD5
268
* 3 - DES_MAC
269
* 4 - HMAC_SHA1
270
* Sealing values are:
271
* 0 - default (DES)
272
* 1 - DES
273
* 2 - DES3-KD
274
*
275
* @param optionalHeader an optional header that will be processed first
276
* during checksum calculation
277
*
278
* @param data the application data to checksum
279
* @param offset the offset where the data starts
280
* @param len the length of the data
281
*
282
* @param optionalTrailer an optional trailer that will be processed
283
* last during checksum calculation. e.g., padding that should be
284
* appended to the application data
285
*
286
* @throws GSSException if an error occurs in the checksum calculation or
287
* encryption sequence number calculation.
288
*/
289
public void genSignAndSeqNumber(MessageProp prop,
290
byte[] optionalHeader,
291
byte[] data, int offset, int len,
292
byte[] optionalTrailer)
293
throws GSSException {
294
295
// debug("Inside MessageToken.genSignAndSeqNumber:\n");
296
297
int qop = prop.getQOP();
298
if (qop != 0) {
299
qop = 0;
300
prop.setQOP(qop);
301
}
302
303
if (!confState) {
304
prop.setPrivacy(false);
305
}
306
307
// Create a token header with the correct sign and seal algorithm
308
// values.
309
tokenHeader =
310
new MessageTokenHeader(tokenId, prop.getPrivacy(), qop);
311
312
// Calculate SGN_CKSUM
313
314
checksum =
315
getChecksum(optionalHeader, data, offset, len, optionalTrailer);
316
317
// debug("\n\tCalc checksum=" +
318
// getHexBytes(checksum, checksum.length));
319
320
// Calculate SND_SEQ
321
322
seqNumberData = new byte[8];
323
324
// When using this RC4 based encryption type, the sequence number is
325
// always sent in big-endian rather than little-endian order.
326
if (cipherHelper.isArcFour()) {
327
writeBigEndian(seqNumber, seqNumberData);
328
} else {
329
// for all other etypes
330
writeLittleEndian(seqNumber, seqNumberData);
331
}
332
if (!initiator) {
333
seqNumberData[4] = (byte)0xff;
334
seqNumberData[5] = (byte)0xff;
335
seqNumberData[6] = (byte)0xff;
336
seqNumberData[7] = (byte)0xff;
337
}
338
339
encSeqNumber = cipherHelper.encryptSeq(checksum, seqNumberData, 0, 8);
340
341
// debug("\n\tCalc seqNum=" +
342
// getHexBytes(seqNumberData, seqNumberData.length));
343
// debug("\n\tCalc encSeqNum=" +
344
// getHexBytes(encSeqNumber, encSeqNumber.length));
345
}
346
347
/**
348
* Verifies that the checksum field and sequence number direction bytes
349
* are valid and consistent with the application data.
350
*
351
* @param optionalHeader an optional header that will be processed first
352
* during checksum calculation.
353
*
354
* @param data the application data
355
* @param offset the offset where the data begins
356
* @param len the length of the application data
357
*
358
* @param optionalTrailer an optional trailer that will be processed last
359
* during checksum calculation. e.g., padding that should be appended to
360
* the application data
361
*
362
* @throws GSSException if an error occurs in the checksum calculation or
363
* encryption sequence number calculation.
364
*/
365
public final boolean verifySignAndSeqNumber(byte[] optionalHeader,
366
byte[] data, int offset, int len,
367
byte[] optionalTrailer)
368
throws GSSException {
369
// debug("\tIn verifySign:\n");
370
371
// debug("\t\tchecksum: [" + getHexBytes(checksum) + "]\n");
372
373
byte[] myChecksum =
374
getChecksum(optionalHeader, data, offset, len, optionalTrailer);
375
376
// debug("\t\tmychecksum: [" + getHexBytes(myChecksum) +"]\n");
377
// debug("\t\tchecksum: [" + getHexBytes(checksum) + "]\n");
378
379
if (MessageDigest.isEqual(checksum, myChecksum)) {
380
381
seqNumberData = cipherHelper.decryptSeq(
382
checksum, encSeqNumber, 0, 8);
383
384
// debug("\t\tencSeqNumber: [" + getHexBytes(encSeqNumber)
385
// + "]\n");
386
// debug("\t\tseqNumberData: [" + getHexBytes(seqNumberData)
387
// + "]\n");
388
389
/*
390
* The token from the initiator has direction bytes 0x00 and
391
* the token from the acceptor has direction bytes 0xff.
392
*/
393
byte directionByte = 0;
394
if (initiator)
395
directionByte = (byte) 0xff; // Received token from acceptor
396
397
if ((seqNumberData[4] == directionByte) &&
398
(seqNumberData[5] == directionByte) &&
399
(seqNumberData[6] == directionByte) &&
400
(seqNumberData[7] == directionByte))
401
return true;
402
}
403
404
return false;
405
406
}
407
408
public final int getSequenceNumber() {
409
int sequenceNum = 0;
410
if (cipherHelper.isArcFour()) {
411
sequenceNum = readBigEndian(seqNumberData, 0, 4);
412
} else {
413
sequenceNum = readLittleEndian(seqNumberData, 0, 4);
414
}
415
return sequenceNum;
416
}
417
418
/**
419
* Computes the checksum based on the algorithm stored in the
420
* tokenHeader.
421
*
422
* @param optionalHeader an optional header that will be processed first
423
* during checksum calculation.
424
*
425
* @param data the application data
426
* @param offset the offset where the data begins
427
* @param len the length of the application data
428
*
429
* @param optionalTrailer an optional trailer that will be processed last
430
* during checksum calculation. e.g., padding that should be appended to
431
* the application data
432
*
433
* @throws GSSException if an error occurs in the checksum calculation.
434
*/
435
private byte[] getChecksum(byte[] optionalHeader,
436
byte[] data, int offset, int len,
437
byte[] optionalTrailer)
438
throws GSSException {
439
440
// debug("Will do getChecksum:\n");
441
442
/*
443
* For checksum calculation the token header bytes i.e., the first 8
444
* bytes following the GSSHeader, are logically prepended to the
445
* application data to bind the data to this particular token.
446
*
447
* Note: There is no such requirement wrt adding padding to the
448
* application data for checksumming, although the cryptographic
449
* algorithm used might itself apply some padding.
450
*/
451
452
byte[] tokenHeaderBytes = tokenHeader.getBytes();
453
byte[] existingHeader = optionalHeader;
454
byte[] checksumDataHeader = tokenHeaderBytes;
455
456
if (existingHeader != null) {
457
checksumDataHeader = new byte[tokenHeaderBytes.length +
458
existingHeader.length];
459
System.arraycopy(tokenHeaderBytes, 0,
460
checksumDataHeader, 0, tokenHeaderBytes.length);
461
System.arraycopy(existingHeader, 0,
462
checksumDataHeader, tokenHeaderBytes.length,
463
existingHeader.length);
464
}
465
466
return cipherHelper.calculateChecksum(tokenHeader.getSignAlg(),
467
checksumDataHeader, optionalTrailer, data, offset, len, tokenId);
468
}
469
470
471
/**
472
* Constructs an empty MessageToken for the local context to send to
473
* the peer. It also increments the local sequence number in the
474
* Krb5Context instance it uses after obtaining the object lock for
475
* it.
476
*
477
* @param tokenId the token id that should be contained in this token
478
* @param context the Kerberos context associated with this token
479
*/
480
MessageToken(int tokenId, Krb5Context context) throws GSSException {
481
/*
482
debug("\n============================");
483
debug("\nMySessionKey=" +
484
getHexBytes(context.getMySessionKey().getBytes()));
485
debug("\nPeerSessionKey=" +
486
getHexBytes(context.getPeerSessionKey().getBytes()));
487
debug("\n============================\n");
488
*/
489
init(tokenId, context);
490
this.seqNumber = context.incrementMySequenceNumber();
491
}
492
493
private void init(int tokenId, Krb5Context context) throws GSSException {
494
this.tokenId = tokenId;
495
// Just for consistency check in Wrap
496
this.confState = context.getConfState();
497
498
this.initiator = context.isInitiator();
499
500
this.cipherHelper = context.getCipherHelper(null);
501
// debug("In MessageToken.Cons");
502
}
503
504
/**
505
* Encodes a GSSHeader and this token onto an OutputStream.
506
*
507
* @param os the OutputStream to which this should be written
508
* @throws GSSException if an error occurs while writing to the OutputStream
509
*/
510
public void encode(OutputStream os) throws IOException, GSSException {
511
gssHeader = new GSSHeader(OID, getKrb5TokenSize());
512
gssHeader.encode(os);
513
tokenHeader.encode(os);
514
// debug("Writing seqNumber: " + getHexBytes(encSeqNumber));
515
os.write(encSeqNumber);
516
// debug("Writing checksum: " + getHexBytes(checksum));
517
os.write(checksum);
518
}
519
520
/**
521
* Obtains the size of this token. Note that this excludes the size of
522
* the GSSHeader.
523
* @return token size
524
*/
525
protected int getKrb5TokenSize() throws GSSException {
526
return getTokenSize();
527
}
528
529
protected final int getTokenSize() throws GSSException {
530
return TOKEN_NO_CKSUM_SIZE + cipherHelper.getChecksumLength();
531
}
532
533
protected static final int getTokenSize(CipherHelper ch)
534
throws GSSException {
535
return TOKEN_NO_CKSUM_SIZE + ch.getChecksumLength();
536
}
537
538
/**
539
* Obtains the conext key that is associated with this token.
540
* @return the context key
541
*/
542
/*
543
public final byte[] getContextKey() {
544
return contextKey;
545
}
546
*/
547
548
/**
549
* Obtains the encryption algorithm that should be used in this token
550
* given the state of confidentiality the application requested.
551
* Requested qop must be consistent with negotiated session key.
552
* @param confRequested true if the application desired confidentiality
553
* on this token, false otherwise
554
* @param qop the qop requested by the application
555
* @throws GSSException if qop is incompatible with the negotiated
556
* session key
557
*/
558
protected abstract int getSealAlg(boolean confRequested, int qop)
559
throws GSSException;
560
561
// ******************************************* //
562
// I N N E R C L A S S E S F O L L O W
563
// ******************************************* //
564
565
/**
566
* This inner class represents the initial portion of the message token
567
* and contains information about the checksum and encryption algorithms
568
* that are in use. It constitutes the first 8 bytes of the
569
* message token:
570
* <pre>
571
* 0..1 TOK_ID Identification field.
572
* 01 01 - Mic token
573
* 02 01 - Wrap token
574
* 2..3 SGN_ALG Checksum algorithm indicator.
575
* 00 00 - DES MAC MD5
576
* 01 00 - MD2.5
577
* 02 00 - DES MAC
578
* 04 00 - HMAC SHA1 DES3-KD
579
* 11 00 - RC4-HMAC
580
* 4..5 SEAL_ALG ff ff - none
581
* 00 00 - DES
582
* 02 00 - DES3-KD
583
* 10 00 - RC4-HMAC
584
* 6..7 Filler Contains ff ff
585
* </pre>
586
*/
587
class MessageTokenHeader {
588
589
private int tokenId;
590
private int signAlg;
591
private int sealAlg;
592
593
private byte[] bytes = new byte[8];
594
595
/**
596
* Constructs a MessageTokenHeader for the specified token type with
597
* appropriate checksum and encryption algorithms fields.
598
*
599
* @param tokenId the token id for this message token
600
* @param conf true if confidentiality will be resuested with this
601
* message token, false otherwise.
602
* @param qop the value of the quality of protection that will be
603
* desired.
604
*/
605
public MessageTokenHeader(int tokenId, boolean conf, int qop)
606
throws GSSException {
607
608
this.tokenId = tokenId;
609
610
signAlg = MessageToken.this.getSgnAlg(qop);
611
612
sealAlg = MessageToken.this.getSealAlg(conf, qop);
613
614
bytes[0] = (byte) (tokenId >>> 8);
615
bytes[1] = (byte) (tokenId);
616
617
bytes[2] = (byte) (signAlg >>> 8);
618
bytes[3] = (byte) (signAlg);
619
620
bytes[4] = (byte) (sealAlg >>> 8);
621
bytes[5] = (byte) (sealAlg);
622
623
bytes[6] = (byte) (MessageToken.FILLER >>> 8);
624
bytes[7] = (byte) (MessageToken.FILLER);
625
}
626
627
/**
628
* Constructs a MessageTokenHeader by reading it from an InputStream
629
* and sets the appropriate confidentiality and quality of protection
630
* values in a MessageProp structure.
631
*
632
* @param is the InputStream to read from
633
* @param prop the MessageProp to populate
634
* @throws IOException is an error occurs while reading from the
635
* InputStream
636
*/
637
public MessageTokenHeader(InputStream is, MessageProp prop)
638
throws IOException {
639
readFully(is, bytes);
640
tokenId = readInt(bytes, TOKEN_ID_POS);
641
signAlg = readInt(bytes, SIGN_ALG_POS);
642
sealAlg = readInt(bytes, SEAL_ALG_POS);
643
// debug("\nMessageTokenHeader read tokenId=" +
644
// getHexBytes(bytes) + "\n");
645
// XXX compare to FILLER
646
int temp = readInt(bytes, SEAL_ALG_POS + 2);
647
648
// debug("SIGN_ALG=" + signAlg);
649
650
switch (sealAlg) {
651
case SEAL_ALG_DES:
652
case SEAL_ALG_DES3_KD:
653
case SEAL_ALG_ARCFOUR_HMAC:
654
prop.setPrivacy(true);
655
break;
656
657
default:
658
prop.setPrivacy(false);
659
}
660
661
prop.setQOP(0); // default
662
}
663
664
/**
665
* Encodes this MessageTokenHeader onto an OutputStream
666
* @param os the OutputStream to write to
667
* @throws IOException is an error occurs while writing
668
*/
669
public final void encode(OutputStream os) throws IOException {
670
os.write(bytes);
671
}
672
673
674
/**
675
* Returns the token id for the message token.
676
* @return the token id
677
* @see sun.security.jgss.krb5.Krb5Token#MIC_ID
678
* @see sun.security.jgss.krb5.Krb5Token#WRAP_ID
679
*/
680
public final int getTokenId() {
681
return tokenId;
682
}
683
684
/**
685
* Returns the sign algorithm for the message token.
686
* @return the sign algorithm
687
* @see sun.security.jgss.krb5.MessageToken#SIGN_DES_MAC
688
* @see sun.security.jgss.krb5.MessageToken#SIGN_DES_MAC_MD5
689
*/
690
public final int getSignAlg() {
691
return signAlg;
692
}
693
694
/**
695
* Returns the seal algorithm for the message token.
696
* @return the seal algorithm
697
* @see sun.security.jgss.krb5.MessageToken#SEAL_ALG_DES
698
* @see sun.security.jgss.krb5.MessageToken#SEAL_ALG_NONE
699
*/
700
public final int getSealAlg() {
701
return sealAlg;
702
}
703
704
/**
705
* Returns the bytes of this header.
706
* @return 8 bytes that form this header
707
*/
708
public final byte[] getBytes() {
709
return bytes;
710
}
711
} // end of class MessageTokenHeader
712
713
714
/**
715
* Determine signing algorithm based on QOP.
716
*/
717
protected int getSgnAlg(int qop) throws GSSException {
718
// QOP ignored
719
return cipherHelper.getSgnAlg();
720
}
721
}
722
723