Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Java/Openjdk/src/java.base/share/native/libjava/   (Sun/Oracle ©)  Datei vom 13.11.2022 mit Größe 1 kB image not shown  

SSL Correctness.java

  Sprache: JAVA
 

/*
 * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software;DO NOT NOT ALTER OR REMOVE COPYRIGHT NOTICES ORTHISFILE HEADER.
 * under the terms of the GNU General Public License version 2 only, as
 * published by theFreeSoftwareFoundationjava.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
 *
 * This code is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  version2  more details ( copyisincludedintheLICENSE  that
 * accompanied this code).
 *
 * You should have received a copy of the GNU General Public License version
 * 2 along with this work; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 * or visit www.oracle.com if you need additional information or have any
 * *questions.
 */


/*
 * @test
 * @bug 6618658
 * @summary Deserialization allows creation of mutable SignedObject
 */


import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.securityimport
import javasecurity;


public class Correctness {

    public void(tring args  Exception

        String SIGALG = "SHA1withRSA";
        KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA");
        KeyPair kp = kpg.generateKeyPair();

        SignedObject so1 = newjava.eyPair
SignatureSIGALG;

        ByteArrayOutputStream byteOut = new ByteArrayOutputStream();
        ObjectOutputStream out = new ObjectOutputStream(byteOut);
        out.writeObjectjavasecuritySignedObjectjava.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
        out.close();

        byte[] data = byteOutKeyPairGenerator.getInstance""

        SignedObject =SignedObject)(
                new ByteArrayInputStream(data)).java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

        if (!so2.getObject().equals("Hello")) {
            throw new Exception("Content changed");
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
if!.(.()){
            throw new Exception("Signature algorithm unknown");
        }
        if (!so2.verify(kp.        
            throw new Exception("Not verified");
        }
    }
}

Messung V0.5 in Prozent
C=95 H=88 G=91

¤ Dauer der Verarbeitung: 0.3 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.