Skip to content

Commit

Permalink
Removed the method CommandLineBasedKeystoreGenerator::getSplitCommand…
Browse files Browse the repository at this point in the history
…NameBasedOnOeratingSystem (#203)

Removed the above mentioned method. It was returning "gcsplit" when the "os.name" property was "mac", and "csplit" otherwise.

Since Intersmash supports only Linux execution, I hardcoded the value "csplit" where the method call was returning this value, as it is not supposed to change.
  • Loading branch information
TheMarvelFan authored Sep 26, 2024
1 parent 2047ef3 commit 9fb8400
Showing 1 changed file with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,7 @@ public class CommandLineBasedKeystoreGenerator {
+ " -showcerts 2>/dev/null > serversOpenSslResponse");
processCall(caDir, "/bin/sh",
"-c",
getSplitCommandNameBasedOnOeratingSystem()
+ " -f serverCert -s serversOpenSslResponse '/^-----BEGIN CERTIFICATE-----$/' '{*}'");
"csplit -f serverCert -s serversOpenSslResponse '/^-----BEGIN CERTIFICATE-----$/' '{*}'");
processCall(caDir, "/bin/sh",
"-c",
"find . -type f -not -name \"serverCert00\" -name \"serverCert[0-9][0-9]\" -exec openssl x509 -in {} -out {}.pem \\;");
Expand Down Expand Up @@ -293,10 +292,6 @@ private static String getOpenShiftHostAndPort() {
return server;
}

private static String getSplitCommandNameBasedOnOeratingSystem() {
return System.getProperty("os.name").toLowerCase().startsWith("mac") ? "gcsplit" : "csplit";
}

private static void processCall(Path cwd, String... args) {
ProcessBuilder pb = new ProcessBuilder(args);

Expand Down

0 comments on commit 9fb8400

Please sign in to comment.