sun.security.krb5.internal.rcache.AuthTimeWithHash Java Examples

The following examples show how to use sun.security.krb5.internal.rcache.AuthTimeWithHash. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ReplayCache.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public static ReplayCache getInstance(String type) {
    if (type == null) {
        return new MemoryCache();
    } else if (type.equals("dfl") || type.startsWith("dfl:")) {
        return new DflCache(type);
    } else if (type.equals("none")) {
        return new ReplayCache() {
            @Override
            public void checkAndStore(KerberosTime currTime, AuthTimeWithHash time)
                    throws KrbApErrException {
                // no check at all
            }
        };
    } else {
        throw new IllegalArgumentException("Unknown type: " + type);
    }
}
 
Example #2
Source File: ReplayCache.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
public static ReplayCache getInstance(String type) {
    if (type == null) {
        return new MemoryCache();
    } else if (type.equals("dfl") || type.startsWith("dfl:")) {
        return new DflCache(type);
    } else if (type.equals("none")) {
        return new ReplayCache() {
            @Override
            public void checkAndStore(KerberosTime currTime, AuthTimeWithHash time)
                    throws KrbApErrException {
                // no check at all
            }
        };
    } else {
        throw new IllegalArgumentException("Unknown type: " + type);
    }
}
 
Example #3
Source File: ReplayCache.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
public static ReplayCache getInstance(String type) {
    if (type == null) {
        return new MemoryCache();
    } else if (type.equals("dfl") || type.startsWith("dfl:")) {
        return new DflCache(type);
    } else if (type.equals("none")) {
        return new ReplayCache() {
            @Override
            public void checkAndStore(KerberosTime currTime, AuthTimeWithHash time)
                    throws KrbApErrException {
                // no check at all
            }
        };
    } else {
        throw new IllegalArgumentException("Unknown type: " + type);
    }
}
 
Example #4
Source File: ReplayCache.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public static ReplayCache getInstance(String type) {
    if (type == null) {
        return new MemoryCache();
    } else if (type.equals("dfl") || type.startsWith("dfl:")) {
        return new DflCache(type);
    } else if (type.equals("none")) {
        return new ReplayCache() {
            @Override
            public void checkAndStore(KerberosTime currTime, AuthTimeWithHash time)
                    throws KrbApErrException {
                // no check at all
            }
        };
    } else {
        throw new IllegalArgumentException("Unknown type: " + type);
    }
}
 
Example #5
Source File: ReplayCache.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
public static ReplayCache getInstance(String type) {
    if (type == null) {
        return new MemoryCache();
    } else if (type.equals("dfl") || type.startsWith("dfl:")) {
        return new DflCache(type);
    } else if (type.equals("none")) {
        return new ReplayCache() {
            @Override
            public void checkAndStore(KerberosTime currTime, AuthTimeWithHash time)
                    throws KrbApErrException {
                // no check at all
            }
        };
    } else {
        throw new IllegalArgumentException("Unknown type: " + type);
    }
}
 
Example #6
Source File: ReplayCache.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public static ReplayCache getInstance(String type) {
    if (type == null) {
        return new MemoryCache();
    } else if (type.equals("dfl") || type.startsWith("dfl:")) {
        return new DflCache(type);
    } else if (type.equals("none")) {
        return new ReplayCache() {
            @Override
            public void checkAndStore(KerberosTime currTime, AuthTimeWithHash time)
                    throws KrbApErrException {
                // no check at all
            }
        };
    } else {
        throw new IllegalArgumentException("Unknown type: " + type);
    }
}
 
Example #7
Source File: ReplayCache.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
public static ReplayCache getInstance(String type) {
    if (type == null) {
        return new MemoryCache();
    } else if (type.equals("dfl") || type.startsWith("dfl:")) {
        return new DflCache(type);
    } else if (type.equals("none")) {
        return new ReplayCache() {
            @Override
            public void checkAndStore(KerberosTime currTime, AuthTimeWithHash time)
                    throws KrbApErrException {
                // no check at all
            }
        };
    } else {
        throw new IllegalArgumentException("Unknown type: " + type);
    }
}
 
Example #8
Source File: ReplayCache.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
public static ReplayCache getInstance(String type) {
    if (type == null) {
        return new MemoryCache();
    } else if (type.equals("dfl") || type.startsWith("dfl:")) {
        return new DflCache(type);
    } else if (type.equals("none")) {
        return new ReplayCache() {
            @Override
            public void checkAndStore(KerberosTime currTime, AuthTimeWithHash time)
                    throws KrbApErrException {
                // no check at all
            }
        };
    } else {
        throw new IllegalArgumentException("Unknown type: " + type);
    }
}
 
Example #9
Source File: ReplayCache.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
public static ReplayCache getInstance(String type) {
    if (type == null) {
        return new MemoryCache();
    } else if (type.equals("dfl") || type.startsWith("dfl:")) {
        return new DflCache(type);
    } else if (type.equals("none")) {
        return new ReplayCache() {
            @Override
            public void checkAndStore(KerberosTime currTime, AuthTimeWithHash time)
                    throws KrbApErrException {
                // no check at all
            }
        };
    } else {
        throw new IllegalArgumentException("Unknown type: " + type);
    }
}
 
Example #10
Source File: ReplayCache.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
public static ReplayCache getInstance(String type) {
    if (type == null) {
        return new MemoryCache();
    } else if (type.equals("dfl") || type.startsWith("dfl:")) {
        return new DflCache(type);
    } else if (type.equals("none")) {
        return new ReplayCache() {
            @Override
            public void checkAndStore(KerberosTime currTime, AuthTimeWithHash time)
                    throws KrbApErrException {
                // no check at all
            }
        };
    } else {
        throw new IllegalArgumentException("Unknown type: " + type);
    }
}
 
Example #11
Source File: ReplayCache.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public static ReplayCache getInstance(String type) {
    if (type == null) {
        return new MemoryCache();
    } else if (type.equals("dfl") || type.startsWith("dfl:")) {
        return new DflCache(type);
    } else if (type.equals("none")) {
        return new ReplayCache() {
            @Override
            public void checkAndStore(KerberosTime currTime, AuthTimeWithHash time)
                    throws KrbApErrException {
                // no check at all
            }
        };
    } else {
        throw new IllegalArgumentException("Unknown type: " + type);
    }
}
 
Example #12
Source File: ReplayCache.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
public static ReplayCache getInstance(String type) {
    if (type == null) {
        return new MemoryCache();
    } else if (type.equals("dfl") || type.startsWith("dfl:")) {
        return new DflCache(type);
    } else if (type.equals("none")) {
        return new ReplayCache() {
            @Override
            public void checkAndStore(KerberosTime currTime, AuthTimeWithHash time)
                    throws KrbApErrException {
                // no check at all
            }
        };
    } else {
        throw new IllegalArgumentException("Unknown type: " + type);
    }
}
 
Example #13
Source File: ReplayCache.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
public static ReplayCache getInstance(String type) {
    if (type == null) {
        return new MemoryCache();
    } else if (type.equals("dfl") || type.startsWith("dfl:")) {
        return new DflCache(type);
    } else if (type.equals("none")) {
        return new ReplayCache() {
            @Override
            public void checkAndStore(KerberosTime currTime, AuthTimeWithHash time)
                    throws KrbApErrException {
                // no check at all
            }
        };
    } else {
        throw new IllegalArgumentException("Unknown type: " + type);
    }
}
 
Example #14
Source File: ReplayCachePrecise.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) throws Exception {

        AuthTimeWithHash a1 = new AuthTimeWithHash(client, server, time(0), 0,
                "1111111111111111");
        AuthTimeWithHash a2 = new AuthTimeWithHash(client, server, time(0), 0,
                "2222222222222222");
        KerberosTime now = new KerberosTime(time(0)*1000L);

        // When all new styles, must exact match
        ReplayCache cache = ReplayCache.getInstance("dfl:./c1");
        cache.checkAndStore(now, a1);
        cache.checkAndStore(now, a2);

        // When only old style in cache, partial match
        cache = ReplayCache.getInstance("dfl:./c2");
        cache.checkAndStore(now, a1);
        // A small surgery to remove the new style from the cache file
        SeekableByteChannel ch = Files.newByteChannel(Paths.get("c2"),
                StandardOpenOption.WRITE,
                StandardOpenOption.READ);
        ch.position(6);
        ch.write(ByteBuffer.wrap(a1.encode(false)));
        ch.truncate(ch.position());
        ch.close();
        try {
            cache.checkAndStore(now, a2);
            throw new Exception();
        } catch (KrbException ke) {
            // Correct
            System.out.println(ke);
        }
    }
 
Example #15
Source File: ReplayCachePrecise.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) throws Exception {

        AuthTimeWithHash a1 = new AuthTimeWithHash(client, server, time(0), 0,
                "1111111111111111");
        AuthTimeWithHash a2 = new AuthTimeWithHash(client, server, time(0), 0,
                "2222222222222222");
        KerberosTime now = new KerberosTime(time(0)*1000L);

        // When all new styles, must exact match
        ReplayCache cache = ReplayCache.getInstance("dfl:./c1");
        cache.checkAndStore(now, a1);
        cache.checkAndStore(now, a2);

        // When only old style in cache, partial match
        cache = ReplayCache.getInstance("dfl:./c2");
        cache.checkAndStore(now, a1);
        // A small surgery to remove the new style from the cache file
        SeekableByteChannel ch = Files.newByteChannel(Paths.get("c2"),
                StandardOpenOption.WRITE,
                StandardOpenOption.READ);
        ch.position(6);
        ch.write(ByteBuffer.wrap(a1.encode(false)));
        ch.truncate(ch.position());
        ch.close();
        try {
            cache.checkAndStore(now, a2);
            throw new Exception();
        } catch (KrbException ke) {
            // Correct
            System.out.println(ke);
        }
    }
 
Example #16
Source File: ReplayCachePrecise.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) throws Exception {

        AuthTimeWithHash a1 = new AuthTimeWithHash(client, server, time(0), 0,
                "1111111111111111");
        AuthTimeWithHash a2 = new AuthTimeWithHash(client, server, time(0), 0,
                "2222222222222222");
        KerberosTime now = new KerberosTime(time(0)*1000L);

        // When all new styles, must exact match
        ReplayCache cache = ReplayCache.getInstance("dfl:./c1");
        cache.checkAndStore(now, a1);
        cache.checkAndStore(now, a2);

        // When only old style in cache, partial match
        cache = ReplayCache.getInstance("dfl:./c2");
        cache.checkAndStore(now, a1);
        // A small surgery to remove the new style from the cache file
        SeekableByteChannel ch = Files.newByteChannel(Paths.get("c2"),
                StandardOpenOption.WRITE,
                StandardOpenOption.READ);
        ch.position(6);
        ch.write(ByteBuffer.wrap(a1.encode(false)));
        ch.truncate(ch.position());
        ch.close();
        try {
            cache.checkAndStore(now, a2);
            throw new Exception();
        } catch (KrbException ke) {
            // Correct
            System.out.println(ke);
        }
    }
 
Example #17
Source File: ReplayCachePrecise.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) throws Exception {

        AuthTimeWithHash a1 = new AuthTimeWithHash(client, server, time(0), 0,
                "1111111111111111");
        AuthTimeWithHash a2 = new AuthTimeWithHash(client, server, time(0), 0,
                "2222222222222222");
        KerberosTime now = new KerberosTime(time(0)*1000L);

        // When all new styles, must exact match
        ReplayCache cache = ReplayCache.getInstance("dfl:./c1");
        cache.checkAndStore(now, a1);
        cache.checkAndStore(now, a2);

        // When only old style in cache, partial match
        cache = ReplayCache.getInstance("dfl:./c2");
        cache.checkAndStore(now, a1);
        // A small surgery to remove the new style from the cache file
        SeekableByteChannel ch = Files.newByteChannel(Paths.get("c2"),
                StandardOpenOption.WRITE,
                StandardOpenOption.READ);
        ch.position(6);
        ch.write(ByteBuffer.wrap(a1.encode(false)));
        ch.truncate(ch.position());
        ch.close();
        try {
            cache.checkAndStore(now, a2);
            throw new Exception();
        } catch (KrbException ke) {
            // Correct
            System.out.println(ke);
        }
    }
 
Example #18
Source File: ReplayCachePrecise.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) throws Exception {

        AuthTimeWithHash a1 = new AuthTimeWithHash(client, server, time(0), 0,
                "1111111111111111");
        AuthTimeWithHash a2 = new AuthTimeWithHash(client, server, time(0), 0,
                "2222222222222222");
        KerberosTime now = new KerberosTime(time(0)*1000L);

        // When all new styles, must exact match
        ReplayCache cache = ReplayCache.getInstance("dfl:./c1");
        cache.checkAndStore(now, a1);
        cache.checkAndStore(now, a2);

        // When only old style in cache, partial match
        cache = ReplayCache.getInstance("dfl:./c2");
        cache.checkAndStore(now, a1);
        // A small surgery to remove the new style from the cache file
        SeekableByteChannel ch = Files.newByteChannel(Paths.get("c2"),
                StandardOpenOption.WRITE,
                StandardOpenOption.READ);
        ch.position(6);
        ch.write(ByteBuffer.wrap(a1.encode(false)));
        ch.truncate(ch.position());
        ch.close();
        try {
            cache.checkAndStore(now, a2);
            throw new Exception();
        } catch (KrbException ke) {
            // Correct
            System.out.println(ke);
        }
    }
 
Example #19
Source File: ReplayCachePrecise.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) throws Exception {

        AuthTimeWithHash a1 = new AuthTimeWithHash(client, server, time(0), 0,
                "HASH", "1111111111111111");
        AuthTimeWithHash a2 = new AuthTimeWithHash(client, server, time(0), 0,
                "HASH", "2222222222222222");
        KerberosTime now = new KerberosTime(time(0)*1000L);

        // When all new styles, must exact match
        ReplayCache cache = ReplayCache.getInstance("dfl:./c1");
        cache.checkAndStore(now, a1);
        cache.checkAndStore(now, a2);

        // When only old style in cache, partial match
        cache = ReplayCache.getInstance("dfl:./c2");
        cache.checkAndStore(now, a1);
        // A small surgery to remove the new style from the cache file
        SeekableByteChannel ch = Files.newByteChannel(Paths.get("c2"),
                StandardOpenOption.WRITE,
                StandardOpenOption.READ);
        ch.position(6);
        ch.write(ByteBuffer.wrap(a1.encode(false)));
        ch.truncate(ch.position());
        ch.close();
        try {
            cache.checkAndStore(now, a2);
            throw new Exception();
        } catch (KrbException ke) {
            // Correct
            System.out.println(ke);
        }
    }
 
Example #20
Source File: ReplayCachePrecise.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) throws Exception {

        AuthTimeWithHash a1 = new AuthTimeWithHash(client, server, time(0), 0,
                "1111111111111111");
        AuthTimeWithHash a2 = new AuthTimeWithHash(client, server, time(0), 0,
                "2222222222222222");
        KerberosTime now = new KerberosTime(time(0)*1000L);

        // When all new styles, must exact match
        ReplayCache cache = ReplayCache.getInstance("dfl:./c1");
        cache.checkAndStore(now, a1);
        cache.checkAndStore(now, a2);

        // When only old style in cache, partial match
        cache = ReplayCache.getInstance("dfl:./c2");
        cache.checkAndStore(now, a1);
        // A small surgery to remove the new style from the cache file
        SeekableByteChannel ch = Files.newByteChannel(Paths.get("c2"),
                StandardOpenOption.WRITE,
                StandardOpenOption.READ);
        ch.position(6);
        ch.write(ByteBuffer.wrap(a1.encode(false)));
        ch.truncate(ch.position());
        ch.close();
        try {
            cache.checkAndStore(now, a2);
            throw new Exception();
        } catch (KrbException ke) {
            // Correct
            System.out.println(ke);
        }
    }
 
Example #21
Source File: ReplayCachePrecise.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) throws Exception {

        AuthTimeWithHash a1 = new AuthTimeWithHash(client, server, time(0), 0,
                "1111111111111111");
        AuthTimeWithHash a2 = new AuthTimeWithHash(client, server, time(0), 0,
                "2222222222222222");
        KerberosTime now = new KerberosTime(time(0)*1000L);

        // When all new styles, must exact match
        ReplayCache cache = ReplayCache.getInstance("dfl:./c1");
        cache.checkAndStore(now, a1);
        cache.checkAndStore(now, a2);

        // When only old style in cache, partial match
        cache = ReplayCache.getInstance("dfl:./c2");
        cache.checkAndStore(now, a1);
        // A small surgery to remove the new style from the cache file
        SeekableByteChannel ch = Files.newByteChannel(Paths.get("c2"),
                StandardOpenOption.WRITE,
                StandardOpenOption.READ);
        ch.position(6);
        ch.write(ByteBuffer.wrap(a1.encode(false)));
        ch.truncate(ch.position());
        ch.close();
        try {
            cache.checkAndStore(now, a2);
            throw new Exception();
        } catch (KrbException ke) {
            // Correct
            System.out.println(ke);
        }
    }
 
Example #22
Source File: ReplayCachePrecise.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) throws Exception {

        AuthTimeWithHash a1 = new AuthTimeWithHash(client, server, time(0), 0,
                "1111111111111111");
        AuthTimeWithHash a2 = new AuthTimeWithHash(client, server, time(0), 0,
                "2222222222222222");
        KerberosTime now = new KerberosTime(time(0)*1000L);

        // When all new styles, must exact match
        ReplayCache cache = ReplayCache.getInstance("dfl:./c1");
        cache.checkAndStore(now, a1);
        cache.checkAndStore(now, a2);

        // When only old style in cache, partial match
        cache = ReplayCache.getInstance("dfl:./c2");
        cache.checkAndStore(now, a1);
        // A small surgery to remove the new style from the cache file
        SeekableByteChannel ch = Files.newByteChannel(Paths.get("c2"),
                StandardOpenOption.WRITE,
                StandardOpenOption.READ);
        ch.position(6);
        ch.write(ByteBuffer.wrap(a1.encode(false)));
        ch.truncate(ch.position());
        ch.close();
        try {
            cache.checkAndStore(now, a2);
            throw new Exception();
        } catch (KrbException ke) {
            // Correct
            System.out.println(ke);
        }
    }
 
Example #23
Source File: ReplayCachePrecise.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) throws Exception {

        AuthTimeWithHash a1 = new AuthTimeWithHash(client, server, time(0), 0,
                "1111111111111111");
        AuthTimeWithHash a2 = new AuthTimeWithHash(client, server, time(0), 0,
                "2222222222222222");
        KerberosTime now = new KerberosTime(time(0)*1000L);

        // When all new styles, must exact match
        ReplayCache cache = ReplayCache.getInstance("dfl:./c1");
        cache.checkAndStore(now, a1);
        cache.checkAndStore(now, a2);

        // When only old style in cache, partial match
        cache = ReplayCache.getInstance("dfl:./c2");
        cache.checkAndStore(now, a1);
        // A small surgery to remove the new style from the cache file
        SeekableByteChannel ch = Files.newByteChannel(Paths.get("c2"),
                StandardOpenOption.WRITE,
                StandardOpenOption.READ);
        ch.position(6);
        ch.write(ByteBuffer.wrap(a1.encode(false)));
        ch.truncate(ch.position());
        ch.close();
        try {
            cache.checkAndStore(now, a2);
            throw new Exception();
        } catch (KrbException ke) {
            // Correct
            System.out.println(ke);
        }
    }
 
Example #24
Source File: ReplayCachePrecise.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) throws Exception {

        AuthTimeWithHash a1 = new AuthTimeWithHash(client, server, time(0), 0,
                "1111111111111111");
        AuthTimeWithHash a2 = new AuthTimeWithHash(client, server, time(0), 0,
                "2222222222222222");
        KerberosTime now = new KerberosTime(time(0)*1000L);

        // When all new styles, must exact match
        ReplayCache cache = ReplayCache.getInstance("dfl:./c1");
        cache.checkAndStore(now, a1);
        cache.checkAndStore(now, a2);

        // When only old style in cache, partial match
        cache = ReplayCache.getInstance("dfl:./c2");
        cache.checkAndStore(now, a1);
        // A small surgery to remove the new style from the cache file
        SeekableByteChannel ch = Files.newByteChannel(Paths.get("c2"),
                StandardOpenOption.WRITE,
                StandardOpenOption.READ);
        ch.position(6);
        ch.write(ByteBuffer.wrap(a1.encode(false)));
        ch.truncate(ch.position());
        ch.close();
        try {
            cache.checkAndStore(now, a2);
            throw new Exception();
        } catch (KrbException ke) {
            // Correct
            System.out.println(ke);
        }
    }
 
Example #25
Source File: ReplayCachePrecise.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) throws Exception {

        AuthTimeWithHash a1 = new AuthTimeWithHash(client, server, time(0), 0,
                "1111111111111111");
        AuthTimeWithHash a2 = new AuthTimeWithHash(client, server, time(0), 0,
                "2222222222222222");
        KerberosTime now = new KerberosTime(time(0)*1000L);

        // When all new styles, must exact match
        ReplayCache cache = ReplayCache.getInstance("dfl:./c1");
        cache.checkAndStore(now, a1);
        cache.checkAndStore(now, a2);

        // When only old style in cache, partial match
        cache = ReplayCache.getInstance("dfl:./c2");
        cache.checkAndStore(now, a1);
        // A small surgery to remove the new style from the cache file
        SeekableByteChannel ch = Files.newByteChannel(Paths.get("c2"),
                StandardOpenOption.WRITE,
                StandardOpenOption.READ);
        ch.position(6);
        ch.write(ByteBuffer.wrap(a1.encode(false)));
        ch.truncate(ch.position());
        ch.close();
        try {
            cache.checkAndStore(now, a2);
            throw new Exception();
        } catch (KrbException ke) {
            // Correct
            System.out.println(ke);
        }
    }
 
Example #26
Source File: ReplayCachePrecise.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) throws Exception {

        AuthTimeWithHash a1 = new AuthTimeWithHash(client, server, time(0), 0,
                "1111111111111111");
        AuthTimeWithHash a2 = new AuthTimeWithHash(client, server, time(0), 0,
                "2222222222222222");
        KerberosTime now = new KerberosTime(time(0)*1000L);

        // When all new styles, must exact match
        ReplayCache cache = ReplayCache.getInstance("dfl:./c1");
        cache.checkAndStore(now, a1);
        cache.checkAndStore(now, a2);

        // When only old style in cache, partial match
        cache = ReplayCache.getInstance("dfl:./c2");
        cache.checkAndStore(now, a1);
        // A small surgery to remove the new style from the cache file
        SeekableByteChannel ch = Files.newByteChannel(Paths.get("c2"),
                StandardOpenOption.WRITE,
                StandardOpenOption.READ);
        ch.position(6);
        ch.write(ByteBuffer.wrap(a1.encode(false)));
        ch.truncate(ch.position());
        ch.close();
        try {
            cache.checkAndStore(now, a2);
            throw new Exception();
        } catch (KrbException ke) {
            // Correct
            System.out.println(ke);
        }
    }
 
Example #27
Source File: ReplayCache.java    From jdk8u-jdk with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Accepts or rejects an AuthTime.
 * @param currTime the current time
 * @param time AuthTimeWithHash object calculated from authenticator
 * @throws KrbApErrException if the authenticator is a replay
 */
public abstract void checkAndStore(KerberosTime currTime, AuthTimeWithHash time)
        throws KrbApErrException;
 
Example #28
Source File: ReplayCache.java    From jdk8u_jdk with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Accepts or rejects an AuthTime.
 * @param currTime the current time
 * @param time AuthTimeWithHash object calculated from authenticator
 * @throws KrbApErrException if the authenticator is a replay
 */
public abstract void checkAndStore(KerberosTime currTime, AuthTimeWithHash time)
        throws KrbApErrException;
 
Example #29
Source File: ReplayCache.java    From jdk8u-dev-jdk with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Accepts or rejects an AuthTime.
 * @param currTime the current time
 * @param time AuthTimeWithHash object calculated from authenticator
 * @throws KrbApErrException if the authenticator is a replay
 */
public abstract void checkAndStore(KerberosTime currTime, AuthTimeWithHash time)
        throws KrbApErrException;
 
Example #30
Source File: ReplayCache.java    From jdk8u-jdk with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Accepts or rejects an AuthTime.
 * @param currTime the current time
 * @param time AuthTimeWithHash object calculated from authenticator
 * @throws KrbApErrException if the authenticator is a replay
 */
public abstract void checkAndStore(KerberosTime currTime, AuthTimeWithHash time)
        throws KrbApErrException;