Return-Path: X-Original-To: apmail-oltu-commits-archive@www.apache.org Delivered-To: apmail-oltu-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EB75D10D07 for ; Fri, 20 Sep 2013 07:25:21 +0000 (UTC) Received: (qmail 50201 invoked by uid 500); 20 Sep 2013 07:25:21 -0000 Delivered-To: apmail-oltu-commits-archive@oltu.apache.org Received: (qmail 50190 invoked by uid 500); 20 Sep 2013 07:25:20 -0000 Mailing-List: contact commits-help@oltu.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@oltu.apache.org Delivered-To: mailing list commits@oltu.apache.org Received: (qmail 50183 invoked by uid 99); 20 Sep 2013 07:25:18 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 Sep 2013 07:25:18 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.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; Fri, 20 Sep 2013 07:25:16 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 6F34E23888A6; Fri, 20 Sep 2013 07:24:55 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1524921 - /oltu/trunk/jose/jws/src/main/java/org/apache/oltu/jose/jws/JWS.java Date: Fri, 20 Sep 2013 07:24:55 -0000 To: commits@oltu.apache.org From: simonetripodi@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20130920072455.6F34E23888A6@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: simonetripodi Date: Fri Sep 20 07:24:55 2013 New Revision: 1524921 URL: http://svn.apache.org/r1524921 Log: OLTU-118 - Implement JWS of the JOSE working group verification method has to make sure that JWS has a payload and a signature in order to execute the verify method Modified: oltu/trunk/jose/jws/src/main/java/org/apache/oltu/jose/jws/JWS.java Modified: oltu/trunk/jose/jws/src/main/java/org/apache/oltu/jose/jws/JWS.java URL: http://svn.apache.org/viewvc/oltu/trunk/jose/jws/src/main/java/org/apache/oltu/jose/jws/JWS.java?rev=1524921&r1=1524920&r2=1524921&view=diff ============================================================================== --- oltu/trunk/jose/jws/src/main/java/org/apache/oltu/jose/jws/JWS.java (original) +++ oltu/trunk/jose/jws/src/main/java/org/apache/oltu/jose/jws/JWS.java Fri Sep 20 07:24:55 2013 @@ -70,6 +70,12 @@ public class JWS { if (header == null || header.getAlgorithm() == null) { throw new IllegalStateException("JWS token must have a valid JSON header with specified algorithm."); } + if (payload == null) { + throw new IllegalStateException("JWS token must have a payload."); + } + if (signature == null) { + throw new IllegalStateException("JWS token must have a signature to be verified."); + } if (!header.getAlgorithm().equalsIgnoreCase(method.getAlgorithm())) { throw new IllegalArgumentException("Impossible to verify current JWS signature with algorithm '"