9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 */ 23 24 /** 25 * @test %I% %E% 26 * @bug 6824440 6858484 27 * @summary Check that Apache XMLSec APIs will not accept HMAC truncation 28 * lengths less than minimum bound 29 * @compile -XDignore.symbol.file TruncateHMAC.java 30 * @run main TruncateHMAC 31 */ 32 33 import java.io.File; 34 import javax.crypto.SecretKey; 35 import javax.xml.parsers.DocumentBuilderFactory; 36 import org.w3c.dom.Document; 37 import org.w3c.dom.Element; 38 import org.w3c.dom.NodeList; 39 40 import com.sun.org.apache.xml.internal.security.Init; 41 import com.sun.org.apache.xml.internal.security.c14n.Canonicalizer; 42 import com.sun.org.apache.xml.internal.security.signature.XMLSignature; 43 import com.sun.org.apache.xml.internal.security.signature.XMLSignatureException; 44 import com.sun.org.apache.xml.internal.security.utils.Constants; 45 46 47 public class TruncateHMAC { 48 | 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 */ 23 24 /** 25 * @test %I% %E% 26 * @bug 6824440 6858484 27 * @summary Check that Apache XMLSec APIs will not accept HMAC truncation 28 * lengths less than minimum bound 29 * @modules java.xml.crypto/com.sun.org.apache.xml.internal.security 30 * java.xml.crypto/com.sun.org.apache.xml.internal.security.c14n 31 * java.xml.crypto/com.sun.org.apache.xml.internal.security.signature 32 * java.xml.crypto/com.sun.org.apache.xml.internal.security.utils 33 * @compile -XDignore.symbol.file TruncateHMAC.java 34 * @run main TruncateHMAC 35 */ 36 37 import java.io.File; 38 import javax.crypto.SecretKey; 39 import javax.xml.parsers.DocumentBuilderFactory; 40 import org.w3c.dom.Document; 41 import org.w3c.dom.Element; 42 import org.w3c.dom.NodeList; 43 44 import com.sun.org.apache.xml.internal.security.Init; 45 import com.sun.org.apache.xml.internal.security.c14n.Canonicalizer; 46 import com.sun.org.apache.xml.internal.security.signature.XMLSignature; 47 import com.sun.org.apache.xml.internal.security.signature.XMLSignatureException; 48 import com.sun.org.apache.xml.internal.security.utils.Constants; 49 50 51 public class TruncateHMAC { 52 |