]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
gnutls_openpgp_crt_get_auth_subkey() will no longer return an unsupported subkey.
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Tue, 15 Mar 2011 22:22:36 +0000 (23:22 +0100)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Tue, 15 Mar 2011 22:45:26 +0000 (23:45 +0100)
lib/openpgp/pgp.c

index 35f0fcc75ae12a29d790b4639864c349c89ededb..ffee4c9db7831be4291d2df67ca03a4220baa7e1 100644 (file)
@@ -388,7 +388,7 @@ gnutls_openpgp_crt_get_name (gnutls_openpgp_crt_t key,
  * For DSA the bits returned are of the public exponent.
  *
  * Returns: a member of the #gnutls_pk_algorithm_t enumeration on
- *   success, or a negative value on error.
+ *   success, or GNUTLS_PK_UNKNOWN on error.
  **/
 gnutls_pk_algorithm_t
 gnutls_openpgp_crt_get_pk_algorithm (gnutls_openpgp_crt_t key,
@@ -850,7 +850,7 @@ gnutls_openpgp_crt_get_subkey_revoked_status (gnutls_openpgp_crt_t key,
  * For DSA the bits returned are of the public exponent.
  *
  * Returns: a member of the #gnutls_pk_algorithm_t enumeration on
- *   success, or a negative value on error.
+ *   success, or GNUTLS_PK_UNKNOWN on error.
  *
  * Since: 2.4.0
  **/
@@ -1646,7 +1646,10 @@ gnutls_openpgp_crt_get_auth_subkey (gnutls_openpgp_crt_t crt,
    */
   for (i = 0; i < subkeys; i++)
     {
-
+      ret = gnutls_openpgp_crt_get_subkey_pk_algorithm(crt, i, NULL);
+      if (ret == GNUTLS_PK_UNKNOWN)
+        continue;
+      
       ret = gnutls_openpgp_crt_get_subkey_revoked_status (crt, i);
       if (ret != 0)             /* it is revoked. ignore it */
         continue;