X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=src%2Fshare%2Fm%2Fgen_subkey;h=cf1ed0cc08dd4d0bb9c19672318fa28d8f3d66f1;hb=cf7d2f1e843e429a462d2dd11430fd48b0281cb2;hp=dbd9dd69da0da47ae2fc51bf0508b550794fd9ad;hpb=0d07156e8db60611c28e5f440ff5f6a39d655ff6;p=monkeysphere.git diff --git a/src/share/m/gen_subkey b/src/share/m/gen_subkey index dbd9dd6..cf1ed0c 100644 --- a/src/share/m/gen_subkey +++ b/src/share/m/gen_subkey @@ -19,6 +19,7 @@ gen_subkey(){ local keyID local editCommands local fifoDir + local keyType # get options while true ; do @@ -43,31 +44,48 @@ Type '$PGRM help' for usage." # check that an authentication subkey does not already exist check_gpg_authentication_subkey "$keyID" + # determine which keyType to use from gpg version + keyType=7 + case $(gpg --version | head -1 | awk '{ print $3 }' | cut -d. -f1) in + 1) + if is_gpg_version_greater_equal 1.4.10 ; then + keyType=8 + fi + ;; + 2) + if is_gpg_version_greater_equal 2.0.13 ; then + keyType=8 + fi + ;; + *) + keyType=8 + ;; + esac + # generate the list of commands that will be passed to edit-key - editCommands=$(cat <