]
Darran Lofthouse reassigned ELY-1242:
-------------------------------------
Assignee: (was: Darran Lofthouse)
External CS, create attribute is ignored
----------------------------------------
Key: ELY-1242
URL:
https://issues.jboss.org/browse/ELY-1242
Project: WildFly Elytron
Issue Type: Bug
Reporter: Martin Choma
Priority: Blocker
{{location=secretdatafile}} have to exists, otherwise there occures NoSuchFileException
{code}
09:13:34,368 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC000001:
Failed to start service org.wildfly.security.credential-store.fips-credential-store:
org.jboss.msc.service.StartException in service
org.wildfly.security.credential-store.fips-credential-store: WFLYELY00004: Unable to start
the service.
at
org.wildfly.extension.elytron.CredentialStoreService.start(CredentialStoreService.java:123)
at
org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:2032)
at
org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1955)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.wildfly.security.credential.store.CredentialStoreException: ELY09514:
Unable to initialize credential store
at
org.wildfly.security.credential.store.impl.KeyStoreCredentialStore.setupExternalStorage(KeyStoreCredentialStore.java:945)
at
org.wildfly.security.credential.store.impl.KeyStoreCredentialStore.load(KeyStoreCredentialStore.java:821)
at
org.wildfly.security.credential.store.impl.KeyStoreCredentialStore.initialize(KeyStoreCredentialStore.java:213)
at
org.wildfly.security.credential.store.CredentialStore.initialize(CredentialStore.java:159)
at
org.wildfly.extension.elytron.CredentialStoreService.start(CredentialStoreService.java:117)
... 5 more
Caused by: java.nio.file.NoSuchFileException:
/home/mchoma/workspace/git-repositories/tests-security/fips/target/fips-cs-workdir/secure-data-file
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214)
at java.nio.file.Files.newByteChannel(Files.java:361)
at java.nio.file.Files.newByteChannel(Files.java:407)
at java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:384)
at java.nio.file.Files.newInputStream(Files.java:152)
at
org.wildfly.security.credential.store.impl.KeyStoreCredentialStore.setupExternalStorage(KeyStoreCredentialStore.java:936)
... 9 more
09:13:34,372 ERROR [org.jboss.as.controller.management-operation]
(management-handler-thread - 2) WFLYCTL0013: Operation ("add") failed - address:
([
("subsystem" => "elytron"),
("credential-store" => "fips-credential-store")
]) - failure description: {"WFLYCTL0080: Failed services" =>
{"org.wildfly.security.credential-store.fips-credential-store" =>
"WFLYELY00004: Unable to start the service.
Caused by: org.wildfly.security.credential.store.CredentialStoreException: ELY09514:
Unable to initialize credential store
Caused by: java.nio.file.NoSuchFileException:
/home/mchoma/workspace/git-repositories/tests-security/fips/target/fips-cs-workdir/secure-data-file"}}
{code}
There is missing branch in code when {{create = true}} and {{dataLocation != null}}
{code}
if (useExternalStorage) {
dataLocation = externalPath;
setupExternalStorage(type, location);
} else {
dataLocation = location;
keyStore = getKeyStoreInstance(type);
}
if (create) {
if (dataLocation == null) {
try {
keyStore.load(null, null);
} catch (CertificateException | IOException | NoSuchAlgorithmException e)
{
throw log.cannotInitializeCredentialStore(e);
}
}
}
{code}
This issue pops up in ER1, because file based external CS feature was delivered in ER1
(JBEAP-10803)