]> gitweb.fluxo.info Git - keyringer.git/commitdiff
Expiration check should handle keys without expiry dates
authorSilvio Rhatto <rhatto@riseup.net>
Thu, 13 Feb 2014 13:54:45 +0000 (11:54 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Thu, 13 Feb 2014 13:54:45 +0000 (11:54 -0200)
lib/keyringer/functions

index 810effed7385246b09ccaf302ad76532d862caa6..5cc92b11ad1ac6974e607b37def6528d9be465fd 100755 (executable)
@@ -549,7 +549,7 @@ EOF
       expiry="`gpg --with-colons --fixed-list-mode --list-keys "$recipient" | grep ^pub | cut -d : -f 7`"
 
       # Check if key is expired
-      if [[ "$seconds" -gt "$expiry" ]]; then
+      if [ ! -z "$expiry" ] && [[ "$seconds" -gt "$expiry" ]]; then
         echo "Fatal: primary key for $recipient expired on `date --date="@$expiry"`"
         exit 1
       else