jdk/src/share/classes/sun/security/jgss/krb5/CipherHelper.java
changeset 10336 0bb1999251f8
parent 7801 814c8359b104
equal deleted inserted replaced
10335:3c7eda3ab2f5 10336:0bb1999251f8
     1 /*
     1 /*
     2  * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2004, 2011, 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
   137             flag = true;
   137             flag = true;
   138         }
   138         }
   139         return flag;
   139         return flag;
   140     }
   140     }
   141 
   141 
       
   142     @SuppressWarnings("fallthrough")
   142     byte[] calculateChecksum(int alg, byte[] header, byte[] trailer,
   143     byte[] calculateChecksum(int alg, byte[] header, byte[] trailer,
   143         byte[] data, int start, int len, int tokenId) throws GSSException {
   144         byte[] data, int start, int len, int tokenId) throws GSSException {
   144 
   145 
   145         switch (alg) {
   146         switch (alg) {
   146         case MessageToken.SGN_ALG_DES_MAC_MD5:
   147         case MessageToken.SGN_ALG_DES_MAC_MD5:
  1263 
  1264 
  1264         // get the token Sequence Number required for encryption
  1265         // get the token Sequence Number required for encryption
  1265         // Note: When using this RC4 based encryption type, the sequence number
  1266         // Note: When using this RC4 based encryption type, the sequence number
  1266         // is always sent in big-endian rather than little-endian order.
  1267         // is always sent in big-endian rather than little-endian order.
  1267         byte[] seqNum = new byte[4];
  1268         byte[] seqNum = new byte[4];
  1268         token.writeBigEndian(token.getSequenceNumber(), seqNum);
  1269         WrapToken.writeBigEndian(token.getSequenceNumber(), seqNum);
  1269 
  1270 
  1270         // Krb5Token.debug("\narcFourEncrypt:" + Krb5Token.getHexBytes(all));
  1271         // Krb5Token.debug("\narcFourEncrypt:" + Krb5Token.getHexBytes(all));
  1271 
  1272 
  1272         // Encrypt
  1273         // Encrypt
  1273         try {
  1274         try {