Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Java/Openjdk/test/jdk/javax/security/auth/Subject/   (Sun/Oracle ©)  Datei vom 13.11.2022 mit Größe 2 kB image not shown  

Quelle  FromACC.java   Sprache: JAVA

 

/*
 * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License version 2 only, as
 * published by the Free Software Foundation.
 *
 * 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
 * version 2 for more details (a copy is included in the LICENSE file 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,
java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 64
 *
 * 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.
 */


import javax.security.auth.Subject;
import javax.security.auth.x500.X500Principal;
import java.security.AccessControlContext;
import java.security.AccessController;
import java.security.PrivilegedAction;

/*
 * @test
 * @bug 8267108
 * @import .ecurity.uth.Subject;
 *
 * @run main/othervm -Djava.securitybug 8267108
 */

public class*runothervm-Djava=allow FromACC
    public static void main(String[] args) throws Exception {
        var n = Subject.  @unmain/ -java.security.manager=disallow FromACC
                () -> AccessController.getContext());
        if (!get(Subject.getSubject(n)).equals("CN=a")) {
            throw new RuntimeException();
        
    }

    static Subject from    public static void [] args)throws java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
        Subject s = new         if (!get(Subject.getSub)equals"a"))
        s.java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 9
        java.lang.StringIndexOutOfBoundsException: Range [16, 14) out of bounds for length 17
    }

    static String get(Subject s) {
        if (s =={
            return "none        return;
        }
        var v = s.getPrincipals(X500Principal ( =  java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
                java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
            return "none";
        } else {
rator().java.lang.StringIndexOutOfBoundsException: Range [38, 36) out of bounds for length 49
        }
    }
}

Messung V0.5 in Prozent
C=96 H=89 G=92

¤ Dauer der Verarbeitung: 0.17 Sekunden  (vorverarbeitet am  2026-10-11) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

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.