Imported Upstream version 2.3.8
[platform/upstream/gpg2.git] / agent / findkey.c
index e0db509..20962bd 100644 (file)
@@ -49,7 +49,7 @@ struct try_unprotect_arg_s
 };
 
 
-/* Repalce all linefeeds in STRING by "%0A" and return a new malloced
+/* Replace all linefeeds in STRING by "%0A" and return a new malloced
  * string.  May return NULL on memory error.  */
 static char *
 linefeed_to_percent0A (const char *string)
@@ -1459,16 +1459,12 @@ public_key_from_file (ctrl_t ctrl, const unsigned char *grip,
   if (for_ssh)
     {
       /* Use-for-ssh: yes */
-      const char *p;
       int is_ssh = 0;
 
       if (keymeta == NULL)
         return gpg_error (GPG_ERR_WRONG_KEY_USAGE);
 
-      if ((p = nvc_get_string (keymeta, "Use-for-ssh:"))
-          && !strcmp (p, "yes"))
-        is_ssh = 1;
-
+      is_ssh = nvc_get_boolean (keymeta, "Use-for-ssh:");
       nvc_release (keymeta);
       keymeta = NULL;