From 60deb373081e2c8e1c778b376b42b21daecb398a Mon Sep 17 00:00:00 2001 From: Bela Ban Date: Thu, 12 Oct 2023 12:48:48 +0200 Subject: [PATCH] - ASYM_ENCRYPT checks in init() if the secret key enables encoding (https://issues.redhat.com/browse/JGRP-2735) --- src/org/jgroups/protocols/ASYM_ENCRYPT.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/org/jgroups/protocols/ASYM_ENCRYPT.java b/src/org/jgroups/protocols/ASYM_ENCRYPT.java index 6e4601f225..a1128a0030 100644 --- a/src/org/jgroups/protocols/ASYM_ENCRYPT.java +++ b/src/org/jgroups/protocols/ASYM_ENCRYPT.java @@ -102,6 +102,11 @@ public boolean isKeyServer() { } public void init() throws Exception { + SecretKey k=createSecretKey(); + byte[] encoded=k.getEncoded(); + if(encoded == null) + throw new IllegalArgumentException(String.format("secret key %s/%s does not support encoding (FIPS enabled?)", + k.getAlgorithm(), k.getFormat())); send_group_keys=false; initKeyPair(); super.init();