|
61 | 61 | import java.io.EOFException;
|
62 | 62 | import java.io.IOException;
|
63 | 63 | import java.io.InputStream;
|
64 |
| -import java.io.OutputStream; |
65 | 64 | import java.nio.charset.StandardCharsets;
|
66 | 65 | import java.nio.file.FileSystem;
|
67 | 66 | import java.nio.file.Files;
|
68 | 67 | import java.nio.file.Path;
|
69 |
| -import java.security.GeneralSecurityException; |
70 | 68 | import java.security.KeyStore;
|
71 | 69 | import java.security.KeyStoreException;
|
72 | 70 | import java.security.MessageDigest;
|
@@ -413,31 +411,6 @@ public void testStringAndFileDistinction() throws Exception {
|
413 | 411 | assertThat(toByteArray(afterSave.getFile("file_setting")), equalTo("file_value".getBytes(StandardCharsets.UTF_8)));
|
414 | 412 | }
|
415 | 413 |
|
416 |
| - @AwaitsFix(bugUrl = "https://github.com/opensearch-project/OpenSearch/issues/468") |
417 |
| - public void testLegacyV3() throws GeneralSecurityException, IOException { |
418 |
| - final Path configDir = createTempDir(); |
419 |
| - final Path keystore = configDir.resolve("opensearch.keystore"); |
420 |
| - try ( |
421 |
| - InputStream is = KeyStoreWrapperTests.class.getResourceAsStream("/format-v3-opensearch.keystore"); |
422 |
| - OutputStream os = Files.newOutputStream(keystore) |
423 |
| - ) { |
424 |
| - final byte[] buffer = new byte[4096]; |
425 |
| - int readBytes; |
426 |
| - while ((readBytes = is.read(buffer)) > 0) { |
427 |
| - os.write(buffer, 0, readBytes); |
428 |
| - } |
429 |
| - } |
430 |
| - final KeyStoreWrapper wrapper = KeyStoreWrapper.load(configDir); |
431 |
| - assertNotNull(wrapper); |
432 |
| - wrapper.decrypt(new char[0]); |
433 |
| - assertThat(wrapper.getFormatVersion(), equalTo(3)); |
434 |
| - assertThat(wrapper.getSettingNames(), equalTo(new HashSet<>(Arrays.asList("keystore.seed", "string_setting", "file_setting")))); |
435 |
| - assertThat(wrapper.getString("string_setting"), equalTo("string_value")); |
436 |
| - assertThat(toByteArray(wrapper.getFile("string_setting")), equalTo("string_value".getBytes(StandardCharsets.UTF_8))); |
437 |
| - assertThat(wrapper.getString("file_setting"), equalTo("file_value")); |
438 |
| - assertThat(toByteArray(wrapper.getFile("file_setting")), equalTo("file_value".getBytes(StandardCharsets.UTF_8))); |
439 |
| - } |
440 |
| - |
441 | 414 | private void generateV1() throws IOException, NoSuchAlgorithmException, NoSuchProviderException, CertificateException,
|
442 | 415 | InvalidKeySpecException, KeyStoreException {
|
443 | 416 | Path configDir = env.configDir();
|
|
0 commit comments