2003-07-31  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.texi (Key Management): Add can_authenticate flag.

gpgme/
2003-07-31  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.h (struct _gpgme_subkey): Add flag CAN_AUTHENTICATE.
	Lower _UNUSED to 23 bits.
	(struct _gpgme_key): Likewise.
	* keylist.c (set_mainkey_capability): Support 'a' and 'A'.
	(set_subkey_capability): Support 'a'.
This commit is contained in:
Marcus Brinkmann 2003-07-31 16:59:36 +00:00
parent 82f7a68aa2
commit 9d0642c012
6 changed files with 40 additions and 2 deletions

5
NEWS
View File

@ -4,9 +4,14 @@ Noteworthy changes in version 0.4.3 (unreleased)
* gpgme_get_key fails with GPG_ERR_AMBIGUOUS_NAME if the key ID * gpgme_get_key fails with GPG_ERR_AMBIGUOUS_NAME if the key ID
provided was not unique, instead returning the first matching key. provided was not unique, instead returning the first matching key.
* gpgme_key_t and gpgme_subkey_t have a new field, can_authenticate,
that indicates if the key can be used for authentication.
* Interface changes relative to the 0.4.3 release: * Interface changes relative to the 0.4.3 release:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gpgme_get_key CHANGED: Fails correctly if key ID not unique. gpgme_get_key CHANGED: Fails correctly if key ID not unique.
gpgme_key_t EXTENDED: New field can_authenticate.
gpgme_subkey_t EXTENDED: New field can_authenticate.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@ -1,5 +1,7 @@
2003-07-31 Marcus Brinkmann <marcus@g10code.de> 2003-07-31 Marcus Brinkmann <marcus@g10code.de>
* gpgme.texi (Key Management): Add can_authenticate flag.
* gpgme.texi (Listing Keys): Document GPG_ERR_AMBIGUOUS_NAME for * gpgme.texi (Listing Keys): Document GPG_ERR_AMBIGUOUS_NAME for
gpgme_get_key. gpgme_get_key.

View File

@ -2023,6 +2023,9 @@ This is true if the subkey can be used to create data signatures.
@item unsigned int can_certify : 1 @item unsigned int can_certify : 1
This is true if the subkey can be used to create key certificates. This is true if the subkey can be used to create key certificates.
@item unsigned int can_authenticate : 1
This is true if the subkey can be used for authentication.
@item unsigned int secret : 1 @item unsigned int secret : 1
This is true if the subkey is a secret key. This is true if the subkey is a secret key.
@ -2181,6 +2184,10 @@ data signatures.
This is true if the key (ie one of its subkeys) can be used to create This is true if the key (ie one of its subkeys) can be used to create
key certificates. key certificates.
@item unsigned int can_authenticate : 1
This is true if the key (ie one of its subkeys) can be used for
authentication.
@item unsigned int secret : 1 @item unsigned int secret : 1
This is true if the key is a secret key. This is true if the key is a secret key.

View File

@ -1,5 +1,11 @@
2003-07-31 Marcus Brinkmann <marcus@g10code.de> 2003-07-31 Marcus Brinkmann <marcus@g10code.de>
* gpgme.h (struct _gpgme_subkey): Add flag CAN_AUTHENTICATE.
Lower _UNUSED to 23 bits.
(struct _gpgme_key): Likewise.
* keylist.c (set_mainkey_capability): Support 'a' and 'A'.
(set_subkey_capability): Support 'a'.
* keylist.c (gpgme_get_key): Check if there is more than one key * keylist.c (gpgme_get_key): Check if there is more than one key
listed, and return GPG_ERR_AMBIGUOUS_NAME in that case. listed, and return GPG_ERR_AMBIGUOUS_NAME in that case.

View File

@ -421,8 +421,11 @@ struct _gpgme_subkey
/* True if subkey is secret. */ /* True if subkey is secret. */
unsigned int secret : 1; unsigned int secret : 1;
/* True if subkey can be used for authentication. */
unsigned int can_authenticate : 1;
/* Internal to GPGME, do not use. */ /* Internal to GPGME, do not use. */
unsigned int _unused : 24; unsigned int _unused : 23;
/* Public key algorithm supported by this subkey. */ /* Public key algorithm supported by this subkey. */
gpgme_pubkey_algo_t pubkey_algo; gpgme_pubkey_algo_t pubkey_algo;
@ -572,8 +575,11 @@ struct _gpgme_key
/* True if key is secret. */ /* True if key is secret. */
unsigned int secret : 1; unsigned int secret : 1;
/* True if key can be used for authentication. */
unsigned int can_authenticate : 1;
/* Internal to GPGME, do not use. */ /* Internal to GPGME, do not use. */
unsigned int _unused : 24; unsigned int _unused : 23;
/* This is the protocol supported by this key. */ /* This is the protocol supported by this key. */
gpgme_protocol_t protocol; gpgme_protocol_t protocol;

View File

@ -245,6 +245,10 @@ set_mainkey_capability (gpgme_key_t key, const char *src)
key->subkeys->can_certify = 1; key->subkeys->can_certify = 1;
break; break;
case 'a':
key->subkeys->can_authenticate = 1;
break;
case 'd': case 'd':
case 'D': case 'D':
/* Note, that this flag is also set using the key validity /* Note, that this flag is also set using the key validity
@ -266,6 +270,10 @@ set_mainkey_capability (gpgme_key_t key, const char *src)
case 'C': case 'C':
key->can_certify = 1; key->can_certify = 1;
break; break;
case 'A':
key->can_authenticate = 1;
break;
} }
src++; src++;
} }
@ -290,6 +298,10 @@ set_subkey_capability (gpgme_subkey_t subkey, const char *src)
case 'c': case 'c':
subkey->can_certify = 1; subkey->can_certify = 1;
break; break;
case 'a':
subkey->can_authenticate = 1;
break;
} }
src++; src++;
} }