jdk/src/share/classes/com/sun/crypto/provider/DESedeWrapCipher.java
changeset 15010 ec6b49ce42b1
parent 10336 0bb1999251f8
child 16909 78a1749a43e2
equal deleted inserted replaced
15009:bcb241432928 15010:ec6b49ce42b1
     1 /*
     1 /*
     2  * Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2004, 2013, 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
   215         if (opmode == Cipher.WRAP_MODE) {
   215         if (opmode == Cipher.WRAP_MODE) {
   216             decrypting = false;
   216             decrypting = false;
   217             if (params == null) {
   217             if (params == null) {
   218                 iv = new byte[8];
   218                 iv = new byte[8];
   219                 if (random == null) {
   219                 if (random == null) {
   220                     random = SunJCE.RANDOM;
   220                     random = SunJCE.getRandom();
   221                 }
   221                 }
   222                 random.nextBytes(iv);
   222                 random.nextBytes(iv);
   223             }
   223             }
   224             else if (params instanceof IvParameterSpec) {
   224             else if (params instanceof IvParameterSpec) {
   225                 iv = ((IvParameterSpec) params).getIV();
   225                 iv = ((IvParameterSpec) params).getIV();