equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
24 */ |
24 */ |
25 |
25 |
26 package com.oracle.security.ucrypto; |
26 package com.oracle.security.ucrypto; |
27 |
27 |
28 import java.io.*; |
28 import java.io.*; |
29 import static java.io.StreamTokenizer.*; |
|
30 import java.math.BigInteger; |
29 import java.math.BigInteger; |
31 import java.util.*; |
30 import java.util.*; |
32 |
|
33 import java.security.*; |
31 import java.security.*; |
|
32 |
|
33 import static java.io.StreamTokenizer.*; |
|
34 import static java.nio.charset.StandardCharsets.ISO_8859_1; |
34 |
35 |
35 import sun.security.action.GetPropertyAction; |
36 import sun.security.action.GetPropertyAction; |
36 import sun.security.util.PropertyExpander; |
37 import sun.security.util.PropertyExpander; |
|
38 |
37 |
39 |
38 /** |
40 /** |
39 * Configuration container and file parsing. |
41 * Configuration container and file parsing. |
40 * |
42 * |
41 * Currently, there is only one supported entry "disabledServices" |
43 * Currently, there is only one supported entry "disabledServices" |
64 // Cipher.AES/ECB/PKCS5Padding |
66 // Cipher.AES/ECB/PKCS5Padding |
65 private Set<String> disabledServices; |
67 private Set<String> disabledServices; |
66 |
68 |
67 Config(String filename) throws IOException { |
69 Config(String filename) throws IOException { |
68 FileInputStream in = new FileInputStream(expand(filename)); |
70 FileInputStream in = new FileInputStream(expand(filename)); |
69 reader = new BufferedReader(new InputStreamReader(in, "ISO-8859-1")); |
71 reader = new BufferedReader(new InputStreamReader(in, ISO_8859_1)); |
70 parsedKeywords = new HashSet<String>(); |
72 parsedKeywords = new HashSet<>(); |
71 st = new StreamTokenizer(reader); |
73 st = new StreamTokenizer(reader); |
72 setupTokenizer(); |
74 setupTokenizer(); |
73 parse(); |
75 parse(); |
74 } |
76 } |
75 |
77 |