equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
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 |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
497 * This inner class represents the initial portion of the message token. |
497 * This inner class represents the initial portion of the message token. |
498 * It constitutes the first 16 bytes of the message token. |
498 * It constitutes the first 16 bytes of the message token. |
499 */ |
499 */ |
500 class MessageTokenHeader { |
500 class MessageTokenHeader { |
501 |
501 |
502 private int tokenId; |
502 private int tokenId; |
503 private byte[] bytes = new byte[TOKEN_HEADER_SIZE]; |
503 private byte[] bytes = new byte[TOKEN_HEADER_SIZE]; |
504 |
504 |
505 // Writes a new token header |
505 // Writes a new token header |
506 public MessageTokenHeader(int tokenId, boolean conf) throws GSSException { |
506 public MessageTokenHeader(int tokenId, boolean conf) throws GSSException { |
507 |
507 |
508 this.tokenId = tokenId; |
508 this.tokenId = tokenId; |
509 |
509 |
510 bytes[0] = (byte) (tokenId >>> 8); |
510 bytes[0] = (byte) (tokenId >>> 8); |
511 bytes[1] = (byte) (tokenId); |
511 bytes[1] = (byte) (tokenId); |
607 |
607 |
608 // set default QOP |
608 // set default QOP |
609 prop.setQOP(0); |
609 prop.setQOP(0); |
610 |
610 |
611 // sequence number |
611 // sequence number |
612 seqNumber = readBigEndian(bytes, 0, 8); |
612 seqNumber = readBigEndian(bytes, 12, 4); |
613 } |
613 } |
614 |
614 |
615 /** |
615 /** |
616 * Encodes this MessageTokenHeader onto an OutputStream |
616 * Encodes this MessageTokenHeader onto an OutputStream |
617 * @param os the OutputStream to write to |
617 * @param os the OutputStream to write to |