diff options
author | Hossein <hossein@libreoffice.org> | 2021-09-29 00:12:17 +0200 |
---|---|---|
committer | Hossein <hossein@libreoffice.org> | 2021-09-29 09:34:21 +0200 |
commit | 22483334bf897160494a7223992c5f4a301c82f8 (patch) | |
tree | 6c28adea8b9fa8cd2dd98371b2895d12cc93fc24 /logerrit | |
parent | d4bd8b7b182ac0a015ab0ff69101f33376ce58ae (diff) |
Use ed25519 as default for ssh key pair generation
Use ed25519 algorithms as the default key pair generation algorithm
for the public key cryptography used by ssh in order to submit
patches via 'logerrit' script. If ed25519 is not available, RSA is
used.
List of supported algorithms in OpenSSH can be obtained by invoking
this command:
ssh -Q key
Change-Id: I12ebcbb62d0752c94b8c2d5225223ceb69b7fe79
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122765
Reviewed-by: guilhem <guilhem@libreoffice.org>
Tested-by: Hossein <hossein@libreoffice.org>
Diffstat (limited to 'logerrit')
-rwxr-xr-x | logerrit | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -98,7 +98,18 @@ case "$1" in echo "Hit enter to generate an ssh key - you will need to enter a pass-phrase" echo read -r - ssh-keygen -t rsa -f "$ssh_home/id_rsa" # default type as of OpenSSH 8.1 + all_algo="$(ssh -Q key)" + if grep -q -x ssh-ed25519 <<< "$all_algo" + then + algo="ed25519" + elif grep -q -x ssh-rsa <<< "$all_algo" + then + algo="rsa" + else + echo "Could not find 'ssh-ed25519' or 'ssh-rsa' in the output from 'ssh -Q key'" + exit 1 + fi + ssh-keygen -t "$algo" # Generate the key pair using the selected algorithm fi if test -d "$ssh_home"; then # order algos based on the PubkeyAcceptedKeyTypes option from OpenSSH 8.1 |