summaryrefslogtreecommitdiffstats
path: root/src/main/java/com/gitblit/transport/ssh/SshKey.java
diff options
context:
space:
mode:
authorFlorian Zschocke <f.zschocke+git@gmail.com>2022-11-16 23:08:31 +0100
committerFlorian Zschocke <f.zschocke+git@gmail.com>2022-11-16 23:14:44 +0100
commitc84179a751da1e4bb84e7d30ff848c0d197ec6a2 (patch)
tree584ba5625fa8816c5e8e4874f0937d0fe080474d /src/main/java/com/gitblit/transport/ssh/SshKey.java
parent5fd9d9ef7955bda0129f6e971626c4c1b9dbbc2d (diff)
downloadgitblit-c84179a751da1e4bb84e7d30ff848c0d197ec6a2.tar.gz
gitblit-c84179a751da1e4bb84e7d30ff848c0d197ec6a2.zip
Fix issue with not serialisable ed25519 SSH keys
Adding Ed25519 keys brings the problem that with the library currently used, the PublicKey instance of that key is not serialisable. This results in an exception when wicket tries to cache the UsersPage. So change the SshKeysPanel so that the PublicKey object is removed from the `SshKey` when the panel is detached. It can be regenerated from the raw key data.
Diffstat (limited to 'src/main/java/com/gitblit/transport/ssh/SshKey.java')
-rw-r--r--src/main/java/com/gitblit/transport/ssh/SshKey.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main/java/com/gitblit/transport/ssh/SshKey.java b/src/main/java/com/gitblit/transport/ssh/SshKey.java
index 9fd1005a..cfd7310e 100644
--- a/src/main/java/com/gitblit/transport/ssh/SshKey.java
+++ b/src/main/java/com/gitblit/transport/ssh/SshKey.java
@@ -81,6 +81,15 @@ public class SshKey implements Serializable {
return publicKey;
}
+ public void detachPublicKey()
+ {
+ if (rawData == null) {
+ // Make sure the raw data is available
+ getRawData();
+ }
+ publicKey = null;
+ }
+
public String getAlgorithm() {
return getPublicKey().getAlgorithm();
}