From 428e83de368027235f04782051fab3172a4aeb8a Mon Sep 17 00:00:00 2001 From: Pavel Marek Date: Thu, 4 Jan 2024 17:16:41 +0100 Subject: [PATCH] Remove org.bouncycastle dependency (#8664) Remove `org.bouncycastle` dependency from `org.enso.runtime`. --- build.sbt | 22 +++--------- distribution/engine/THIRD-PARTY/NOTICE | 17 +-------- .../NOTICES | 2 -- .../NOTICES | 36 ------------------- .../NOTICES | 2 -- .../Standard/AWS/0.0.0-dev/THIRD-PARTY/NOTICE | 2 +- .../Base/0.0.0-dev/THIRD-PARTY/NOTICE | 2 +- .../Database/0.0.0-dev/THIRD-PARTY/NOTICE | 2 +- .../Google_Api/0.0.0-dev/THIRD-PARTY/NOTICE | 2 +- .../Image/0.0.0-dev/THIRD-PARTY/NOTICE | 2 +- .../Table/0.0.0-dev/THIRD-PARTY/NOTICE | 2 +- .../project-manager/THIRD-PARTY/NOTICE | 15 -------- .../licenses/Bouncy_Castle_Licence.txt | 7 ---- .../NOTICES | 2 -- .../NOTICES | 16 --------- .../NOTICES | 2 -- .../filemanager/FileManager.scala | 2 +- .../src/main/java/module-info.java | 1 - .../org/enso/interpreter/caches/Cache.java | 10 ++++-- .../src/main/java/org/enso/text/Hex.java | 18 ++++++++++ .../scala/org/enso/text/ContentVersion.scala | 2 -- .../enso/text/Sha3_224VersionCalculator.scala | 4 +-- tools/legal-review/AWS/report-state | 2 +- tools/legal-review/Base/report-state | 2 +- tools/legal-review/Database/report-state | 2 +- tools/legal-review/Google_Api/report-state | 2 +- tools/legal-review/Image/report-state | 2 +- tools/legal-review/Table/report-state | 2 +- .../copyright-add | 1 - .../copyright-ignore | 3 -- .../copyright-keep-context | 2 -- .../copyright-add | 1 - tools/legal-review/engine/report-state | 4 +-- .../copyright-add | 1 - .../copyright-ignore | 3 -- .../copyright-keep | 1 - .../copyright-keep-context | 1 - .../copyright-add | 1 - .../legal-review/project-manager/report-state | 4 +-- .../reviewed-licenses/Bouncy_Castle_Licence | 1 - 40 files changed, 50 insertions(+), 155 deletions(-) delete mode 100644 distribution/engine/THIRD-PARTY/org.bouncycastle.bcpkix-jdk15on-1.70/NOTICES delete mode 100644 distribution/engine/THIRD-PARTY/org.bouncycastle.bcprov-jdk15on-1.70/NOTICES delete mode 100644 distribution/engine/THIRD-PARTY/org.bouncycastle.bcutil-jdk15on-1.70/NOTICES delete mode 100644 distribution/project-manager/THIRD-PARTY/licenses/Bouncy_Castle_Licence.txt delete mode 100644 distribution/project-manager/THIRD-PARTY/org.bouncycastle.bcpkix-jdk15on-1.70/NOTICES delete mode 100644 distribution/project-manager/THIRD-PARTY/org.bouncycastle.bcprov-jdk15on-1.70/NOTICES delete mode 100644 distribution/project-manager/THIRD-PARTY/org.bouncycastle.bcutil-jdk15on-1.70/NOTICES create mode 100644 lib/scala/text-buffer/src/main/java/org/enso/text/Hex.java delete mode 100644 tools/legal-review/engine/org.bouncycastle.bcpkix-jdk15on-1.70/copyright-add delete mode 100644 tools/legal-review/engine/org.bouncycastle.bcprov-jdk15on-1.70/copyright-ignore delete mode 100644 tools/legal-review/engine/org.bouncycastle.bcprov-jdk15on-1.70/copyright-keep-context delete mode 100644 tools/legal-review/engine/org.bouncycastle.bcutil-jdk15on-1.70/copyright-add delete mode 100644 tools/legal-review/project-manager/org.bouncycastle.bcpkix-jdk15on-1.70/copyright-add delete mode 100644 tools/legal-review/project-manager/org.bouncycastle.bcprov-jdk15on-1.70/copyright-ignore delete mode 100644 tools/legal-review/project-manager/org.bouncycastle.bcprov-jdk15on-1.70/copyright-keep delete mode 100644 tools/legal-review/project-manager/org.bouncycastle.bcprov-jdk15on-1.70/copyright-keep-context delete mode 100644 tools/legal-review/project-manager/org.bouncycastle.bcutil-jdk15on-1.70/copyright-add delete mode 100644 tools/legal-review/project-manager/reviewed-licenses/Bouncy_Castle_Licence diff --git a/build.sbt b/build.sbt index abf65aec3e..510445ae72 100644 --- a/build.sbt +++ b/build.sbt @@ -551,10 +551,9 @@ lazy val `text-buffer` = project .settings( frgaalJavaCompilerSetting, libraryDependencies ++= Seq( - "org.typelevel" %% "cats-core" % catsVersion, - "org.bouncycastle" % "bcpkix-jdk15on" % bcpkixJdk15Version, - "org.scalatest" %% "scalatest" % scalatestVersion % Test, - "org.scalacheck" %% "scalacheck" % scalacheckVersion % Test + "org.typelevel" %% "cats-core" % catsVersion, + "org.scalatest" %% "scalatest" % scalatestVersion % Test, + "org.scalacheck" %% "scalacheck" % scalacheckVersion % Test ) ) @@ -1296,13 +1295,9 @@ lazy val `language-server` = (project in file("engine/language-server")) ), Test / modulePath := { val updateReport = (Test / update).value - // org.bouncycastle is a module required by `org.enso.runtime` module. val requiredModIds = GraalVM.modules ++ GraalVM.langsPkgs ++ logbackPkg ++ Seq( - "org.slf4j" % "slf4j-api" % slf4jVersion, - "org.bouncycastle" % "bcutil-jdk18on" % "1.76", - "org.bouncycastle" % "bcpkix-jdk18on" % "1.76", - "org.bouncycastle" % "bcprov-jdk18on" % "1.76" + "org.slf4j" % "slf4j-api" % slf4jVersion ) val requiredMods = JPMSUtils.filterModulesFromUpdate( updateReport, @@ -1976,14 +1971,7 @@ lazy val `runtime-fat-jar` = assembly / test := {}, assembly / assemblyOutputPath := file("runtime.jar"), assembly / assemblyExcludedJars := { - // bouncycastle jdk5 needs to be excluded from the Uber jar, as otherwise its packages would - // clash with packages in org.bouncycastle.jdk18 modules - val bouncyCastleJdk5 = Seq( - "org.bouncycastle" % "bcutil-jdk15on" % bcpkixJdk15Version, - "org.bouncycastle" % "bcpkix-jdk15on" % bcpkixJdk15Version, - "org.bouncycastle" % "bcprov-jdk15on" % bcpkixJdk15Version - ) - val pkgsToExclude = JPMSUtils.componentModules ++ bouncyCastleJdk5 + val pkgsToExclude = JPMSUtils.componentModules val ourFullCp = (Runtime / fullClasspath).value JPMSUtils.filterModulesFromClasspath( ourFullCp, diff --git a/distribution/engine/THIRD-PARTY/NOTICE b/distribution/engine/THIRD-PARTY/NOTICE index 40e4c769ee..2ceedaf9c6 100644 --- a/distribution/engine/THIRD-PARTY/NOTICE +++ b/distribution/engine/THIRD-PARTY/NOTICE @@ -1,5 +1,5 @@ Enso -Copyright 2020 - 2023 New Byte Order sp. z o. o. +Copyright 2020 - 2024 New Byte Order sp. z o. o. 'enumeratum-circe_2.13', licensed under the MIT, is distributed with the engine. The license information can be found along with the copyright notices. @@ -286,31 +286,16 @@ The license file can be found at `licenses/APACHE2.0`. Copyright notices related to this dependency can be found in the directory `org.apache.tika.tika-core-2.4.1`. -'bcpkix-jdk15on', licensed under the Bouncy Castle Licence, is distributed with the engine. -The license file can be found at `licenses/Bouncy_Castle_Licence.txt`. -Copyright notices related to this dependency can be found in the directory `org.bouncycastle.bcpkix-jdk15on-1.70`. - - 'bcpkix-jdk18on', licensed under the Bouncy Castle Licence, is distributed with the engine. The license file can be found at `licenses/Bouncy_Castle_Licence.txt`. Copyright notices related to this dependency can be found in the directory `org.bouncycastle.bcpkix-jdk18on-1.76`. -'bcprov-jdk15on', licensed under the Bouncy Castle Licence, is distributed with the engine. -The license file can be found at `licenses/Bouncy_Castle_Licence.txt`. -Copyright notices related to this dependency can be found in the directory `org.bouncycastle.bcprov-jdk15on-1.70`. - - 'bcprov-jdk18on', licensed under the Bouncy Castle Licence, is distributed with the engine. The license file can be found at `licenses/Bouncy_Castle_Licence.txt`. Copyright notices related to this dependency can be found in the directory `org.bouncycastle.bcprov-jdk18on-1.76`. -'bcutil-jdk15on', licensed under the Bouncy Castle Licence, is distributed with the engine. -The license file can be found at `licenses/Bouncy_Castle_Licence.txt`. -Copyright notices related to this dependency can be found in the directory `org.bouncycastle.bcutil-jdk15on-1.70`. - - 'bcutil-jdk18on', licensed under the Bouncy Castle Licence, is distributed with the engine. The license file can be found at `licenses/Bouncy_Castle_Licence.txt`. Copyright notices related to this dependency can be found in the directory `org.bouncycastle.bcutil-jdk18on-1.76`. diff --git a/distribution/engine/THIRD-PARTY/org.bouncycastle.bcpkix-jdk15on-1.70/NOTICES b/distribution/engine/THIRD-PARTY/org.bouncycastle.bcpkix-jdk15on-1.70/NOTICES deleted file mode 100644 index d3e63d459b..0000000000 --- a/distribution/engine/THIRD-PARTY/org.bouncycastle.bcpkix-jdk15on-1.70/NOTICES +++ /dev/null @@ -1,2 +0,0 @@ -Copyright (c) 2000 - 2020 The Legion of the Bouncy Castle Inc. (https://www.bouncycastle.org) - diff --git a/distribution/engine/THIRD-PARTY/org.bouncycastle.bcprov-jdk15on-1.70/NOTICES b/distribution/engine/THIRD-PARTY/org.bouncycastle.bcprov-jdk15on-1.70/NOTICES deleted file mode 100644 index 0d948de803..0000000000 --- a/distribution/engine/THIRD-PARTY/org.bouncycastle.bcprov-jdk15on-1.70/NOTICES +++ /dev/null @@ -1,36 +0,0 @@ - /* Partially optimised Serpent S Box boolean functions derived */ - /* using a recursive descent analyser but without a full search */ - /* of all subtrees. This set of S boxes is the result of work */ - /* by Sam Simpson and Brian Gladman using the spare time on a */ - /* cluster of high capacity servers to search for S boxes with */ - /* this customised search engine. There are now an average of */ - /* 15.375 terms per S box. */ - /* */ - /* Copyright: Dr B. R Gladman (gladman@seven77.demon.co.uk) */ - /* and Sam Simpson (s.simpson@mia.co.uk) */ - /* 17th December 1998 */ - /* */ - /* We hereby give permission for information in this file to be */ - /* used freely subject only to acknowledgement of its origin. */ - -/** - * The Bouncy Castle License - * - * Copyright (c) 2000-2021 The Legion Of The Bouncy Castle Inc. (https://www.bouncycastle.org) - *

- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software - * and associated documentation files (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - *

- * The above copyright notice and this permission notice shall be included in all copies or substantial - * portions of the Software. - *

- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ diff --git a/distribution/engine/THIRD-PARTY/org.bouncycastle.bcutil-jdk15on-1.70/NOTICES b/distribution/engine/THIRD-PARTY/org.bouncycastle.bcutil-jdk15on-1.70/NOTICES deleted file mode 100644 index d3e63d459b..0000000000 --- a/distribution/engine/THIRD-PARTY/org.bouncycastle.bcutil-jdk15on-1.70/NOTICES +++ /dev/null @@ -1,2 +0,0 @@ -Copyright (c) 2000 - 2020 The Legion of the Bouncy Castle Inc. (https://www.bouncycastle.org) - diff --git a/distribution/lib/Standard/AWS/0.0.0-dev/THIRD-PARTY/NOTICE b/distribution/lib/Standard/AWS/0.0.0-dev/THIRD-PARTY/NOTICE index b4e063c3d9..459116851d 100644 --- a/distribution/lib/Standard/AWS/0.0.0-dev/THIRD-PARTY/NOTICE +++ b/distribution/lib/Standard/AWS/0.0.0-dev/THIRD-PARTY/NOTICE @@ -1,5 +1,5 @@ Enso -Copyright 2020 - 2023 New Byte Order sp. z o. o. +Copyright 2020 - 2024 New Byte Order sp. z o. o. 'redshift-jdbc42', licensed under the Apache License, Version 2.0, is distributed with the AWS. The license information can be found along with the copyright notices. diff --git a/distribution/lib/Standard/Base/0.0.0-dev/THIRD-PARTY/NOTICE b/distribution/lib/Standard/Base/0.0.0-dev/THIRD-PARTY/NOTICE index ef542c1f28..bee0625d3f 100644 --- a/distribution/lib/Standard/Base/0.0.0-dev/THIRD-PARTY/NOTICE +++ b/distribution/lib/Standard/Base/0.0.0-dev/THIRD-PARTY/NOTICE @@ -1,5 +1,5 @@ Enso -Copyright 2020 - 2023 New Byte Order sp. z o. o. +Copyright 2020 - 2024 New Byte Order sp. z o. o. 'icu4j', licensed under the Unicode/ICU License, is distributed with the Base. The license information can be found along with the copyright notices. diff --git a/distribution/lib/Standard/Database/0.0.0-dev/THIRD-PARTY/NOTICE b/distribution/lib/Standard/Database/0.0.0-dev/THIRD-PARTY/NOTICE index 5ab5ec619c..911064a2ae 100644 --- a/distribution/lib/Standard/Database/0.0.0-dev/THIRD-PARTY/NOTICE +++ b/distribution/lib/Standard/Database/0.0.0-dev/THIRD-PARTY/NOTICE @@ -1,5 +1,5 @@ Enso -Copyright 2020 - 2023 New Byte Order sp. z o. o. +Copyright 2020 - 2024 New Byte Order sp. z o. o. 'checker-qual', licensed under the The MIT License, is distributed with the Database. The license information can be found along with the copyright notices. diff --git a/distribution/lib/Standard/Google_Api/0.0.0-dev/THIRD-PARTY/NOTICE b/distribution/lib/Standard/Google_Api/0.0.0-dev/THIRD-PARTY/NOTICE index 5bca34c014..8df68f481e 100644 --- a/distribution/lib/Standard/Google_Api/0.0.0-dev/THIRD-PARTY/NOTICE +++ b/distribution/lib/Standard/Google_Api/0.0.0-dev/THIRD-PARTY/NOTICE @@ -1,5 +1,5 @@ Enso -Copyright 2020 - 2023 New Byte Order sp. z o. o. +Copyright 2020 - 2024 New Byte Order sp. z o. o. 'google-api-client', licensed under the The Apache Software License, Version 2.0, is distributed with the Google_Api. The license file can be found at `licenses/APACHE2.0`. diff --git a/distribution/lib/Standard/Image/0.0.0-dev/THIRD-PARTY/NOTICE b/distribution/lib/Standard/Image/0.0.0-dev/THIRD-PARTY/NOTICE index ed27024490..2688335525 100644 --- a/distribution/lib/Standard/Image/0.0.0-dev/THIRD-PARTY/NOTICE +++ b/distribution/lib/Standard/Image/0.0.0-dev/THIRD-PARTY/NOTICE @@ -1,5 +1,5 @@ Enso -Copyright 2020 - 2023 New Byte Order sp. z o. o. +Copyright 2020 - 2024 New Byte Order sp. z o. o. 'opencv', licensed under the BSD License, is distributed with the Image. The license file can be found at `licenses/BSD-3-Clause`. diff --git a/distribution/lib/Standard/Table/0.0.0-dev/THIRD-PARTY/NOTICE b/distribution/lib/Standard/Table/0.0.0-dev/THIRD-PARTY/NOTICE index 45a0020b09..0e816738e7 100644 --- a/distribution/lib/Standard/Table/0.0.0-dev/THIRD-PARTY/NOTICE +++ b/distribution/lib/Standard/Table/0.0.0-dev/THIRD-PARTY/NOTICE @@ -1,5 +1,5 @@ Enso -Copyright 2020 - 2023 New Byte Order sp. z o. o. +Copyright 2020 - 2024 New Byte Order sp. z o. o. 'curvesapi', licensed under the BSD License, is distributed with the Table. The license file can be found at `licenses/BSD-3-Clause`. diff --git a/distribution/project-manager/THIRD-PARTY/NOTICE b/distribution/project-manager/THIRD-PARTY/NOTICE index 6a5d5e0234..baebff70cd 100644 --- a/distribution/project-manager/THIRD-PARTY/NOTICE +++ b/distribution/project-manager/THIRD-PARTY/NOTICE @@ -246,21 +246,6 @@ The license information can be found along with the copyright notices. Copyright notices related to this dependency can be found in the directory `org.apache.commons.commons-lang3-3.12.0`. -'bcpkix-jdk15on', licensed under the Bouncy Castle Licence, is distributed with the project-manager. -The license file can be found at `licenses/Bouncy_Castle_Licence.txt`. -Copyright notices related to this dependency can be found in the directory `org.bouncycastle.bcpkix-jdk15on-1.70`. - - -'bcprov-jdk15on', licensed under the Bouncy Castle Licence, is distributed with the project-manager. -The license file can be found at `licenses/Bouncy_Castle_Licence.txt`. -Copyright notices related to this dependency can be found in the directory `org.bouncycastle.bcprov-jdk15on-1.70`. - - -'bcutil-jdk15on', licensed under the Bouncy Castle Licence, is distributed with the project-manager. -The license file can be found at `licenses/Bouncy_Castle_Licence.txt`. -Copyright notices related to this dependency can be found in the directory `org.bouncycastle.bcutil-jdk15on-1.70`. - - 'polyglot', licensed under the Universal Permissive License, Version 1.0, is distributed with the project-manager. The license file can be found at `licenses/Universal_Permissive_License__Version_1.0`. Copyright notices related to this dependency can be found in the directory `org.graalvm.polyglot.polyglot-23.1.0`. diff --git a/distribution/project-manager/THIRD-PARTY/licenses/Bouncy_Castle_Licence.txt b/distribution/project-manager/THIRD-PARTY/licenses/Bouncy_Castle_Licence.txt deleted file mode 100644 index 060c529ea0..0000000000 --- a/distribution/project-manager/THIRD-PARTY/licenses/Bouncy_Castle_Licence.txt +++ /dev/null @@ -1,7 +0,0 @@ -Copyright (c) 2000 - 2020 The Legion of the Bouncy Castle Inc. (https://www.bouncycastle.org) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/distribution/project-manager/THIRD-PARTY/org.bouncycastle.bcpkix-jdk15on-1.70/NOTICES b/distribution/project-manager/THIRD-PARTY/org.bouncycastle.bcpkix-jdk15on-1.70/NOTICES deleted file mode 100644 index d3e63d459b..0000000000 --- a/distribution/project-manager/THIRD-PARTY/org.bouncycastle.bcpkix-jdk15on-1.70/NOTICES +++ /dev/null @@ -1,2 +0,0 @@ -Copyright (c) 2000 - 2020 The Legion of the Bouncy Castle Inc. (https://www.bouncycastle.org) - diff --git a/distribution/project-manager/THIRD-PARTY/org.bouncycastle.bcprov-jdk15on-1.70/NOTICES b/distribution/project-manager/THIRD-PARTY/org.bouncycastle.bcprov-jdk15on-1.70/NOTICES deleted file mode 100644 index 17f1b3fd2b..0000000000 --- a/distribution/project-manager/THIRD-PARTY/org.bouncycastle.bcprov-jdk15on-1.70/NOTICES +++ /dev/null @@ -1,16 +0,0 @@ - /* Partially optimised Serpent S Box boolean functions derived */ - /* using a recursive descent analyser but without a full search */ - /* of all subtrees. This set of S boxes is the result of work */ - /* by Sam Simpson and Brian Gladman using the spare time on a */ - /* cluster of high capacity servers to search for S boxes with */ - /* this customised search engine. There are now an average of */ - /* 15.375 terms per S box. */ - /* */ - /* Copyright: Dr B. R Gladman (gladman@seven77.demon.co.uk) */ - /* and Sam Simpson (s.simpson@mia.co.uk) */ - /* 17th December 1998 */ - /* */ - /* We hereby give permission for information in this file to be */ - /* used freely subject only to acknowledgement of its origin. */ - -Copyright (c) 2000-2021 The Legion Of The Bouncy Castle Inc. (https://www.bouncycastle.org) diff --git a/distribution/project-manager/THIRD-PARTY/org.bouncycastle.bcutil-jdk15on-1.70/NOTICES b/distribution/project-manager/THIRD-PARTY/org.bouncycastle.bcutil-jdk15on-1.70/NOTICES deleted file mode 100644 index d3e63d459b..0000000000 --- a/distribution/project-manager/THIRD-PARTY/org.bouncycastle.bcutil-jdk15on-1.70/NOTICES +++ /dev/null @@ -1,2 +0,0 @@ -Copyright (c) 2000 - 2020 The Legion of the Bouncy Castle Inc. (https://www.bouncycastle.org) - diff --git a/engine/language-server/src/main/scala/org/enso/languageserver/filemanager/FileManager.scala b/engine/language-server/src/main/scala/org/enso/languageserver/filemanager/FileManager.scala index ab27b898e6..f45c218bc2 100644 --- a/engine/language-server/src/main/scala/org/enso/languageserver/filemanager/FileManager.scala +++ b/engine/language-server/src/main/scala/org/enso/languageserver/filemanager/FileManager.scala @@ -4,12 +4,12 @@ import akka.actor.{Actor, Props} import akka.pattern.pipe import akka.routing.SmallestMailboxPool import com.typesafe.scalalogging.LazyLogging -import org.bouncycastle.util.encoders.Hex import org.enso.languageserver.data.FileManagerConfig import org.enso.languageserver.effect._ import org.enso.languageserver.filemanager.FileManagerProtocol.TextualFileContent import org.enso.languageserver.monitoring.MonitoringProtocol.{Ping, Pong} import org.enso.languageserver.util.UnhandledLogging +import org.enso.text.Hex import zio._ import java.io.File diff --git a/engine/runtime-fat-jar/src/main/java/module-info.java b/engine/runtime-fat-jar/src/main/java/module-info.java index 223542bf2a..e576e5251e 100644 --- a/engine/runtime-fat-jar/src/main/java/module-info.java +++ b/engine/runtime-fat-jar/src/main/java/module-info.java @@ -8,7 +8,6 @@ open module org.enso.runtime { requires org.graalvm.polyglot; requires org.graalvm.truffle; requires static org.slf4j; - requires org.bouncycastle.provider; uses org.slf4j.spi.SLF4JServiceProvider; diff --git a/engine/runtime/src/main/java/org/enso/interpreter/caches/Cache.java b/engine/runtime/src/main/java/org/enso/interpreter/caches/Cache.java index 3c866c674a..f83cd8bf04 100644 --- a/engine/runtime/src/main/java/org/enso/interpreter/caches/Cache.java +++ b/engine/runtime/src/main/java/org/enso/interpreter/caches/Cache.java @@ -10,15 +10,15 @@ import java.nio.file.NoSuchFileException; import java.nio.file.Path; import java.nio.file.StandardOpenOption; import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; import java.util.Comparator; import java.util.List; import java.util.Optional; import java.util.logging.Level; -import org.bouncycastle.jcajce.provider.digest.SHA1; -import org.bouncycastle.util.encoders.Hex; import org.enso.interpreter.runtime.EnsoContext; import org.enso.logger.masking.MaskedPath; import org.enso.pkg.SourceFile; +import org.enso.text.Hex; /** * Cache encapsulates a common functionality needed to serialize and de-serialize objects, while @@ -393,7 +393,11 @@ public abstract class Cache { * @return digest used for computing hashes */ protected MessageDigest messageDigest() { - return new SHA1.Digest(); + try { + return MessageDigest.getInstance("SHA-1"); + } catch (NoSuchAlgorithmException ex) { + throw new IllegalStateException("Unreachable", ex); + } } /** diff --git a/lib/scala/text-buffer/src/main/java/org/enso/text/Hex.java b/lib/scala/text-buffer/src/main/java/org/enso/text/Hex.java new file mode 100644 index 0000000000..a4f7b96f11 --- /dev/null +++ b/lib/scala/text-buffer/src/main/java/org/enso/text/Hex.java @@ -0,0 +1,18 @@ +package org.enso.text; + +/** + * A utility class that serves as a replacement of some methods from {@code org.bouncycastle}, so + * that we don't have to depend on it. + */ +public final class Hex { + /** Converts the byte array to its hexadecimal String representation. */ + public static String toHexString(byte[] bytes) { + char[] out = new char[bytes.length * 2]; + for (int i = 0; i < bytes.length; i++) { + int v = bytes[i] & 0xFF; + out[i * 2] = Character.forDigit(v >>> 4, 16); + out[i * 2 + 1] = Character.forDigit(v & 0x0F, 16); + } + return new String(out); + } +} diff --git a/lib/scala/text-buffer/src/main/scala/org/enso/text/ContentVersion.scala b/lib/scala/text-buffer/src/main/scala/org/enso/text/ContentVersion.scala index c360567c41..b73988951f 100644 --- a/lib/scala/text-buffer/src/main/scala/org/enso/text/ContentVersion.scala +++ b/lib/scala/text-buffer/src/main/scala/org/enso/text/ContentVersion.scala @@ -1,7 +1,5 @@ package org.enso.text -import org.bouncycastle.util.encoders.Hex - /** Version of the text contents. */ case class ContentVersion(toHexString: String) diff --git a/lib/scala/text-buffer/src/main/scala/org/enso/text/Sha3_224VersionCalculator.scala b/lib/scala/text-buffer/src/main/scala/org/enso/text/Sha3_224VersionCalculator.scala index be6e709d6e..2fd01736bb 100644 --- a/lib/scala/text-buffer/src/main/scala/org/enso/text/Sha3_224VersionCalculator.scala +++ b/lib/scala/text-buffer/src/main/scala/org/enso/text/Sha3_224VersionCalculator.scala @@ -2,14 +2,14 @@ package org.enso.text import java.nio.charset.StandardCharsets -import org.bouncycastle.jcajce.provider.digest.SHA3 +import java.security.MessageDigest /** SHA3-224 digest calculator. */ object Sha3_224VersionCalculator extends ContentBasedVersioning { /** @inheritdoc */ override def evalVersion(content: CharSequence): ContentVersion = { - val digestSHA3 = new SHA3.Digest224() + val digestSHA3 = MessageDigest.getInstance("SHA3-224") val digest = digestSHA3.digest(content.toString.getBytes(StandardCharsets.UTF_8)) ContentVersion(digest) diff --git a/tools/legal-review/AWS/report-state b/tools/legal-review/AWS/report-state index c109d588b7..cbf55afbcb 100644 --- a/tools/legal-review/AWS/report-state +++ b/tools/legal-review/AWS/report-state @@ -1,3 +1,3 @@ 79F8085006CADBE1F915455506E1CDEB9A27B8B59EDFCA78FAA3218A3296DE62 -9881D29C00C41E935A59AE991CB1518925A0CB0DFCC612B09C6C2823F25047D9 +6F5A08E5432F0B0C17A5CFC28207781B7C39E85B120D4F74B9B6AA35FF80E8C0 0 diff --git a/tools/legal-review/Base/report-state b/tools/legal-review/Base/report-state index 52e3a3e77a..d5de58dfbd 100644 --- a/tools/legal-review/Base/report-state +++ b/tools/legal-review/Base/report-state @@ -1,3 +1,3 @@ 58F42EA238F4F16E775412B67F584C74188267FB305705B57A50E10124FE56BC -7C5FEB79459C03EB21D2098EFC33BF7AA26E3C51204A9F32F3DCFC854D5A36A0 +DC3F2E51015236DC72560E5DD29B13156A2244C6753828B6D0848683018D5ABA 0 diff --git a/tools/legal-review/Database/report-state b/tools/legal-review/Database/report-state index 6486f41270..803b803b19 100644 --- a/tools/legal-review/Database/report-state +++ b/tools/legal-review/Database/report-state @@ -1,3 +1,3 @@ 4DFA19B7C7AB8984E827C35E9CA6EF40CC3B246094BB0A763D65AD6BF76F0D26 -A9799420579F008532E370B2E2B7D3A811348AE47C8B408E238B741B68AC5224 +DF30306CEDC69A2DB5BF394CDD77B240B6F6B2E695D4DE6BDC343EAA271CEB34 0 diff --git a/tools/legal-review/Google_Api/report-state b/tools/legal-review/Google_Api/report-state index 88e1c8cf07..c21a6c4f2d 100644 --- a/tools/legal-review/Google_Api/report-state +++ b/tools/legal-review/Google_Api/report-state @@ -1,3 +1,3 @@ C5C845C319F900C420F04C815ACFC315E24C581960BE61B03BB6A2F8D71122C9 -F5B860DA0130C53DB5E531A7FDBBFCB7BB54FCEA064A0C8B250EDB7530D6A611 +12BB786E599BE5441F12C0061839D42DBA889C1FBC45F74938E71F664ABD0E65 0 diff --git a/tools/legal-review/Image/report-state b/tools/legal-review/Image/report-state index c6bfef53a9..4a00b85c82 100644 --- a/tools/legal-review/Image/report-state +++ b/tools/legal-review/Image/report-state @@ -1,3 +1,3 @@ F091B0AA1B0A0AE841293C582ED74A6D26913D9BB4E8C64DF1C8FC466E8418A8 -6C4D25C4E9D8A12671E24EE1E60C49C63E8DBA26BE88480F0E12A9112DBF7C03 +87C7DE197372E63C24D6AF3384EA2898F4ECD5486863DA8520660D597995BE28 0 diff --git a/tools/legal-review/Table/report-state b/tools/legal-review/Table/report-state index 694d56a0be..83bef2910f 100644 --- a/tools/legal-review/Table/report-state +++ b/tools/legal-review/Table/report-state @@ -1,3 +1,3 @@ AE474B24FC7C88ACA56C70EC19DCD5F224178089AA2910DB117EE7D914D6C7FF -A4E29BBEAAEE4B4A5593D949D658170B8591E0FADA2F469CDCBF640B307B74D4 +45B9C528D26D13399A07F9FFE79576924709B1DEB991862372B4AFB185869893 0 diff --git a/tools/legal-review/engine/org.bouncycastle.bcpkix-jdk15on-1.70/copyright-add b/tools/legal-review/engine/org.bouncycastle.bcpkix-jdk15on-1.70/copyright-add deleted file mode 100644 index 24d8e17467..0000000000 --- a/tools/legal-review/engine/org.bouncycastle.bcpkix-jdk15on-1.70/copyright-add +++ /dev/null @@ -1 +0,0 @@ -Copyright (c) 2000 - 2020 The Legion of the Bouncy Castle Inc. (https://www.bouncycastle.org) diff --git a/tools/legal-review/engine/org.bouncycastle.bcprov-jdk15on-1.70/copyright-ignore b/tools/legal-review/engine/org.bouncycastle.bcprov-jdk15on-1.70/copyright-ignore deleted file mode 100644 index c0bffb4a6a..0000000000 --- a/tools/legal-review/engine/org.bouncycastle.bcprov-jdk15on-1.70/copyright-ignore +++ /dev/null @@ -1,3 +0,0 @@ -+ "PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE" -+ "The above copyright notice and this permission notice shall be included in all copies or substantial" -"Copyright (c) 2000-2021 The Legion of the Bouncy Castle Inc. (https://www.bouncycastle.org) " diff --git a/tools/legal-review/engine/org.bouncycastle.bcprov-jdk15on-1.70/copyright-keep-context b/tools/legal-review/engine/org.bouncycastle.bcprov-jdk15on-1.70/copyright-keep-context deleted file mode 100644 index a4beed62e7..0000000000 --- a/tools/legal-review/engine/org.bouncycastle.bcprov-jdk15on-1.70/copyright-keep-context +++ /dev/null @@ -1,2 +0,0 @@ -Copyright: Dr B. R Gladman (gladman@seven77.demon.co.uk) */ -Copyright (c) 2000-2021 The Legion Of The Bouncy Castle Inc. (https://www.bouncycastle.org) diff --git a/tools/legal-review/engine/org.bouncycastle.bcutil-jdk15on-1.70/copyright-add b/tools/legal-review/engine/org.bouncycastle.bcutil-jdk15on-1.70/copyright-add deleted file mode 100644 index 24d8e17467..0000000000 --- a/tools/legal-review/engine/org.bouncycastle.bcutil-jdk15on-1.70/copyright-add +++ /dev/null @@ -1 +0,0 @@ -Copyright (c) 2000 - 2020 The Legion of the Bouncy Castle Inc. (https://www.bouncycastle.org) diff --git a/tools/legal-review/engine/report-state b/tools/legal-review/engine/report-state index cefa6c16ea..769657194d 100644 --- a/tools/legal-review/engine/report-state +++ b/tools/legal-review/engine/report-state @@ -1,3 +1,3 @@ -C8A7F23E0F92119165D3B2ED47723018A69580A04331359C9BE435FD62F93E51 -F31394818AC1E81F6172B92D39A06004A7E24D211399E26DE0EE51F7FE10BFCD +D8B011DD7E11E226FD042DCDEE28B22C5D74D2B7A666346317619CCB487832C4 +0035ED295654FAACCD79D0DA6D2CDDA8E2EC8D0BA9254722FB55C6F622A68B94 0 diff --git a/tools/legal-review/project-manager/org.bouncycastle.bcpkix-jdk15on-1.70/copyright-add b/tools/legal-review/project-manager/org.bouncycastle.bcpkix-jdk15on-1.70/copyright-add deleted file mode 100644 index 24d8e17467..0000000000 --- a/tools/legal-review/project-manager/org.bouncycastle.bcpkix-jdk15on-1.70/copyright-add +++ /dev/null @@ -1 +0,0 @@ -Copyright (c) 2000 - 2020 The Legion of the Bouncy Castle Inc. (https://www.bouncycastle.org) diff --git a/tools/legal-review/project-manager/org.bouncycastle.bcprov-jdk15on-1.70/copyright-ignore b/tools/legal-review/project-manager/org.bouncycastle.bcprov-jdk15on-1.70/copyright-ignore deleted file mode 100644 index c0bffb4a6a..0000000000 --- a/tools/legal-review/project-manager/org.bouncycastle.bcprov-jdk15on-1.70/copyright-ignore +++ /dev/null @@ -1,3 +0,0 @@ -+ "PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE" -+ "The above copyright notice and this permission notice shall be included in all copies or substantial" -"Copyright (c) 2000-2021 The Legion of the Bouncy Castle Inc. (https://www.bouncycastle.org) " diff --git a/tools/legal-review/project-manager/org.bouncycastle.bcprov-jdk15on-1.70/copyright-keep b/tools/legal-review/project-manager/org.bouncycastle.bcprov-jdk15on-1.70/copyright-keep deleted file mode 100644 index df532fd5a9..0000000000 --- a/tools/legal-review/project-manager/org.bouncycastle.bcprov-jdk15on-1.70/copyright-keep +++ /dev/null @@ -1 +0,0 @@ -Copyright (c) 2000-2021 The Legion Of The Bouncy Castle Inc. (https://www.bouncycastle.org) diff --git a/tools/legal-review/project-manager/org.bouncycastle.bcprov-jdk15on-1.70/copyright-keep-context b/tools/legal-review/project-manager/org.bouncycastle.bcprov-jdk15on-1.70/copyright-keep-context deleted file mode 100644 index 72e9b42f58..0000000000 --- a/tools/legal-review/project-manager/org.bouncycastle.bcprov-jdk15on-1.70/copyright-keep-context +++ /dev/null @@ -1 +0,0 @@ -Copyright: Dr B. R Gladman (gladman@seven77.demon.co.uk) */ diff --git a/tools/legal-review/project-manager/org.bouncycastle.bcutil-jdk15on-1.70/copyright-add b/tools/legal-review/project-manager/org.bouncycastle.bcutil-jdk15on-1.70/copyright-add deleted file mode 100644 index 24d8e17467..0000000000 --- a/tools/legal-review/project-manager/org.bouncycastle.bcutil-jdk15on-1.70/copyright-add +++ /dev/null @@ -1 +0,0 @@ -Copyright (c) 2000 - 2020 The Legion of the Bouncy Castle Inc. (https://www.bouncycastle.org) diff --git a/tools/legal-review/project-manager/report-state b/tools/legal-review/project-manager/report-state index e61d50bb69..5d65f231dd 100644 --- a/tools/legal-review/project-manager/report-state +++ b/tools/legal-review/project-manager/report-state @@ -1,3 +1,3 @@ -9D93C578E044AEEE4683119559D7D91A6C43C5BC4B811B81F76FBAB003CD960F -23C9B84A5312F46DAD4EBFB7D0267E4111E16F97BDA00E8C1AEECA0DEBF81CE5 +578C28B786B877E41559F52CBDFBF45DE798CEB12FDF9632A93CC4B1B30C72C6 +D1B18FEE4514908AD689F9B25D7E4445E5F3D75296F136BED478DB855D891F88 0 diff --git a/tools/legal-review/project-manager/reviewed-licenses/Bouncy_Castle_Licence b/tools/legal-review/project-manager/reviewed-licenses/Bouncy_Castle_Licence deleted file mode 100644 index 0df4a92e91..0000000000 --- a/tools/legal-review/project-manager/reviewed-licenses/Bouncy_Castle_Licence +++ /dev/null @@ -1 +0,0 @@ -tools/legal-review/license-texts/Bouncy_Castle_Licence.txt