Return-Path: Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: (qmail 6040 invoked from network); 2 Dec 2010 14:39:52 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 2 Dec 2010 14:39:52 -0000 Received: (qmail 73366 invoked by uid 500); 2 Dec 2010 14:39:51 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 73251 invoked by uid 500); 2 Dec 2010 14:39:51 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 73240 invoked by uid 99); 2 Dec 2010 14:39:50 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Dec 2010 14:39:50 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Dec 2010 14:39:50 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id F10482388A32; Thu, 2 Dec 2010 14:38:17 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1041395 - in /cxf/sandbox/wss4j-1.6-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security: policy/interceptors/SecureConversationTokenInterceptorProvider.java wss4j/policyhandlers/SymmetricBindingHandler.java Date: Thu, 02 Dec 2010 14:38:17 -0000 To: commits@cxf.apache.org From: coheigea@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20101202143817.F10482388A32@eris.apache.org> Author: coheigea Date: Thu Dec 2 14:38:17 2010 New Revision: 1041395 URL: http://svn.apache.org/viewvc?rev=1041395&view=rev Log: Minor update following change to WSS4J caching of SecureRandom instance. Modified: cxf/sandbox/wss4j-1.6-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecureConversationTokenInterceptorProvider.java cxf/sandbox/wss4j-1.6-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/SymmetricBindingHandler.java Modified: cxf/sandbox/wss4j-1.6-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecureConversationTokenInterceptorProvider.java URL: http://svn.apache.org/viewvc/cxf/sandbox/wss4j-1.6-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecureConversationTokenInterceptorProvider.java?rev=1041395&r1=1041394&r2=1041395&view=diff ============================================================================== --- cxf/sandbox/wss4j-1.6-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecureConversationTokenInterceptorProvider.java (original) +++ cxf/sandbox/wss4j-1.6-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecureConversationTokenInterceptorProvider.java Thu Dec 2 14:38:17 2010 @@ -20,7 +20,6 @@ package org.apache.cxf.ws.security.policy.interceptors; import java.security.NoSuchAlgorithmException; -import java.security.SecureRandom; import java.util.Arrays; import java.util.Collection; import java.util.Map; @@ -242,9 +241,7 @@ public class SecureConversationTokenInte byte secret[] = null; writer.writeStartElement(prefix, "RequestedProofToken", namespace); if (clientEntropy == null) { - SecureRandom random = SecureRandom.getInstance("SHA1PRNG"); - secret = new byte[keySize / 8]; - random.nextBytes(secret); + secret = WSSecurityUtil.generateNonce(keySize / 8); writer.writeStartElement(prefix, "BinarySecret", namespace); writer.writeAttribute("Type", namespace + "/Nonce"); Modified: cxf/sandbox/wss4j-1.6-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/SymmetricBindingHandler.java URL: http://svn.apache.org/viewvc/cxf/sandbox/wss4j-1.6-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/SymmetricBindingHandler.java?rev=1041395&r1=1041394&r2=1041395&view=diff ============================================================================== --- cxf/sandbox/wss4j-1.6-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/SymmetricBindingHandler.java (original) +++ cxf/sandbox/wss4j-1.6-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/SymmetricBindingHandler.java Thu Dec 2 14:38:17 2010 @@ -19,8 +19,6 @@ package org.apache.cxf.ws.security.wss4j.policyhandlers; -import java.security.MessageDigest; -import java.security.NoSuchAlgorithmException; import java.util.Date; import java.util.List; import java.util.Vector; @@ -68,6 +66,7 @@ import org.apache.ws.security.message.WS import org.apache.ws.security.message.WSSecTimestamp; import org.apache.ws.security.message.token.SecurityTokenReference; import org.apache.ws.security.util.Base64; +import org.apache.ws.security.util.WSSecurityUtil; /** * @@ -779,14 +778,10 @@ public class SymmetricBindingHandler ext } private String getSHA1(byte[] input) { - MessageDigest sha; try { - sha = MessageDigest.getInstance("SHA-1"); - sha.reset(); - sha.update(input); - byte[] data = sha.digest(); - return Base64.encode(data); - } catch (NoSuchAlgorithmException e) { + byte[] digestBytes = WSSecurityUtil.generateDigest(input); + return Base64.encode(digestBytes); + } catch (WSSecurityException e) { //REVISIT } return null;