Skip to content

Commit 4ef95b0

Browse files
committed
merge conflicts
1 parent ffdb8e2 commit 4ef95b0

File tree

3 files changed

+15
-11
lines changed

3 files changed

+15
-11
lines changed

hbase-common/src/test/java/org/apache/hadoop/hbase/io/crypto/tls/TestX509Util.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ public void testLoadPEMTrustStore() throws Exception {
196196
X509Util.createTrustManager(
197197
x509TestContext.getTrustStoreFile(KeyStoreFileType.PEM).getAbsolutePath(),
198198
x509TestContext.getTrustStorePassword(), KeyStoreFileType.PEM.getPropertyValue(), false,
199-
false);
199+
false, true, true);
200200
}
201201

202202
@Test
@@ -205,7 +205,7 @@ public void testLoadPEMTrustStoreNullPassword() throws Exception {
205205
// Make sure that empty password and null password are treated the same
206206
X509Util.createTrustManager(
207207
x509TestContext.getTrustStoreFile(KeyStoreFileType.PEM).getAbsolutePath(), null,
208-
KeyStoreFileType.PEM.getPropertyValue(), false, false);
208+
KeyStoreFileType.PEM.getPropertyValue(), false, false, true, true);
209209
}
210210

211211
@Test
@@ -215,7 +215,7 @@ public void testLoadPEMTrustStoreAutodetectStoreFileType() throws Exception {
215215
x509TestContext.getTrustStoreFile(KeyStoreFileType.PEM).getAbsolutePath(),
216216
x509TestContext.getTrustStorePassword(), null, // null StoreFileType means 'autodetect from
217217
// file extension'
218-
false, false);
218+
false, false, true, true);
219219
}
220220

221221
@Test
@@ -288,7 +288,8 @@ public void testLoadJKSTrustStoreWithWrongPassword() {
288288
// Attempting to load with the wrong key password should fail
289289
X509Util.createTrustManager(
290290
x509TestContext.getTrustStoreFile(KeyStoreFileType.JKS).getAbsolutePath(),
291-
"wrong password".toCharArray(), KeyStoreFileType.JKS.getPropertyValue(), true, true, true, true);
291+
"wrong password".toCharArray(), KeyStoreFileType.JKS.getPropertyValue(), true, true, true,
292+
true);
292293
});
293294
}
294295

@@ -353,7 +354,7 @@ public void testLoadPKCS12TrustStoreAutodetectStoreFileType() throws Exception {
353354
x509TestContext.getTrustStoreFile(KeyStoreFileType.PKCS12).getAbsolutePath(),
354355
x509TestContext.getTrustStorePassword(), null, // null StoreFileType means 'autodetect from
355356
// file extension'
356-
true, true);
357+
true, true, true, true);
357358
}
358359

359360
@Test
@@ -362,7 +363,8 @@ public void testLoadPKCS12TrustStoreWithWrongPassword() {
362363
// Attempting to load with the wrong key password should fail
363364
X509Util.createTrustManager(
364365
x509TestContext.getTrustStoreFile(KeyStoreFileType.PKCS12).getAbsolutePath(),
365-
"wrong password".toCharArray(), KeyStoreFileType.PKCS12.getPropertyValue(), true, true, true, true);
366+
"wrong password".toCharArray(), KeyStoreFileType.PKCS12.getPropertyValue(), true, true,
367+
true, true);
366368
});
367369
}
368370

hbase-common/src/test/java/org/apache/hadoop/hbase/io/crypto/tls/X509TestContext.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,9 @@ private X509TestContext(Configuration conf, File tempDir, KeyPair trustStoreKeyP
124124
* generated keystore path fields
125125
*/
126126
private X509TestContext(File tempDir, Configuration conf, X509Certificate trustStoreCertificate,
127-
String trustStorePassword, KeyPair trustStoreKeyPair, File trustStoreJksFile,
127+
char[] trustStorePassword, KeyPair trustStoreKeyPair, File trustStoreJksFile,
128128
File trustStorePemFile, File trustStorePkcs12File, KeyPair keyStoreKeyPair,
129-
String keyStorePassword, X509Certificate keyStoreCertificate) {
129+
char[] keyStorePassword, X509Certificate keyStoreCertificate) {
130130
this.tempDir = tempDir;
131131
this.conf = conf;
132132
this.trustStoreCertificate = trustStoreCertificate;
@@ -416,7 +416,8 @@ public void setKeystoreConfigurations(KeyStoreFileType keyStoreFileType, Configu
416416

417417
confToSet.set(X509Util.TLS_CONFIG_KEYSTORE_LOCATION,
418418
this.getKeyStoreFile(keyStoreFileType).getAbsolutePath());
419-
confToSet.set(X509Util.TLS_CONFIG_KEYSTORE_PASSWORD, String.valueOf(this.getKeyStorePassword()));
419+
confToSet.set(X509Util.TLS_CONFIG_KEYSTORE_PASSWORD,
420+
String.valueOf(this.getKeyStorePassword()));
420421
confToSet.set(X509Util.TLS_CONFIG_KEYSTORE_TYPE, keyStoreFileType.getPropertyValue());
421422
}
422423

hbase-server/src/test/java/org/apache/hadoop/hbase/security/AbstractTestMutualTls.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ protected abstract void initialize(Configuration serverConf, Configuration clien
142142

143143
@Before
144144
public void setUp() throws Exception {
145-
x509TestContext = PROVIDER.get(caKeyType, certKeyType, keyPassword);
145+
x509TestContext = PROVIDER.get(caKeyType, certKeyType, keyPassword.toCharArray());
146146
x509TestContext.setConfigurations(KeyStoreFileType.JKS, KeyStoreFileType.JKS);
147147

148148
Configuration serverConf = new Configuration(UTIL.getConfiguration());
@@ -172,7 +172,8 @@ protected void handleCertConfig(Configuration confToSet)
172172
// but since the new client keystore cert is created from a new CA (which the server doesn't
173173
// have),
174174
// the server will not be able to verify it.
175-
X509TestContext context = PROVIDER.get(caKeyType, certKeyType, "random value");
175+
X509TestContext context =
176+
PROVIDER.get(caKeyType, certKeyType, "random value".toCharArray());
176177
context.setKeystoreConfigurations(KeyStoreFileType.JKS, confToSet);
177178
break;
178179
case VERIFIABLE_CERT_WITH_BAD_HOST:

0 commit comments

Comments
 (0)