Apache Lucene open-source search software
SOLR-9606: Change hard-coded keysize from 512 to 1024
Erick Ericksone402a304bf97
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txtindex 3d024566ee6..00c0669a9f3 100644--- a/solr/CHANGES.txt+++ b/solr/CHANGES.txt@@ -185,6 +185,8 @@ Other Changes* SOLR-9597: Add setReadOnly(String ...) to ConnectionImpl (Kevin Risden)+* SOLR-9609: Change hard-coded keysize from 512 to 1024 (Jeremy Martini via Erick Erickson)+================== 6.3.0 ==================Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release.diff --git a/solr/core/src/java/org/apache/solr/util/CryptoKeys.java b/solr/core/src/java/org/apache/solr/util/CryptoKeys.javaindex c110aebcf45..1122860e73b 100644--- a/solr/core/src/java/org/apache/solr/util/CryptoKeys.java+++ b/solr/core/src/java/org/apache/solr/util/CryptoKeys.java@@ -285,6 +285,10 @@ public final class CryptoKeys {private final PrivateKey privateKey;private final SecureRandom random = new SecureRandom();+ // If this ever comes back to haunt us see the discussion at+ // SOLR-9609 for background and code allowing this to go+ // into security.json+ private static final int DEFAULT_KEYPAIR_LENGTH = 1024;public RSAKeyPair() {KeyPairGenerator keyGen = null;@@ -293,7 +297,7 @@ public final class CryptoKeys {} catch (NoSuchAlgorithmException e) {throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, e);}- keyGen.initialize(512);+ keyGen.initialize(DEFAULT_KEYPAIR_LENGTH);java.security.KeyPair keyPair = keyGen.genKeyPair();privateKey = keyPair.getPrivate();publicKey = keyPair.getPublic();