From 9d0642c0125e0cc78e03243aa33dfddf1c065ed0 Mon Sep 17 00:00:00 2001 From: Marcus Brinkmann Date: Thu, 31 Jul 2003 16:59:36 +0000 Subject: [PATCH] doc/ 2003-07-31 Marcus Brinkmann * gpgme.texi (Key Management): Add can_authenticate flag. gpgme/ 2003-07-31 Marcus Brinkmann * 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'. --- NEWS | 5 +++++ doc/ChangeLog | 2 ++ doc/gpgme.texi | 7 +++++++ gpgme/ChangeLog | 6 ++++++ gpgme/gpgme.h | 10 ++++++++-- gpgme/keylist.c | 12 ++++++++++++ 6 files changed, 40 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 0a76003..3311841 100644 --- a/NEWS +++ b/NEWS @@ -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 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: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/doc/ChangeLog b/doc/ChangeLog index 60336a8..b06ffd7 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,5 +1,7 @@ 2003-07-31 Marcus Brinkmann + * gpgme.texi (Key Management): Add can_authenticate flag. + * gpgme.texi (Listing Keys): Document GPG_ERR_AMBIGUOUS_NAME for gpgme_get_key. diff --git a/doc/gpgme.texi b/doc/gpgme.texi index 4a97e8d..018102b 100644 --- a/doc/gpgme.texi +++ b/doc/gpgme.texi @@ -2023,6 +2023,9 @@ This is true if the subkey can be used to create data signatures. @item unsigned int can_certify : 1 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 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 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 This is true if the key is a secret key. diff --git a/gpgme/ChangeLog b/gpgme/ChangeLog index 7108693..eaa9b8a 100644 --- a/gpgme/ChangeLog +++ b/gpgme/ChangeLog @@ -1,5 +1,11 @@ 2003-07-31 Marcus Brinkmann + * 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 listed, and return GPG_ERR_AMBIGUOUS_NAME in that case. diff --git a/gpgme/gpgme.h b/gpgme/gpgme.h index 42b4ec2..2320f90 100644 --- a/gpgme/gpgme.h +++ b/gpgme/gpgme.h @@ -421,8 +421,11 @@ struct _gpgme_subkey /* True if subkey is secret. */ unsigned int secret : 1; + /* True if subkey can be used for authentication. */ + unsigned int can_authenticate : 1; + /* Internal to GPGME, do not use. */ - unsigned int _unused : 24; + unsigned int _unused : 23; /* Public key algorithm supported by this subkey. */ gpgme_pubkey_algo_t pubkey_algo; @@ -572,8 +575,11 @@ struct _gpgme_key /* True if key is secret. */ unsigned int secret : 1; + /* True if key can be used for authentication. */ + unsigned int can_authenticate : 1; + /* Internal to GPGME, do not use. */ - unsigned int _unused : 24; + unsigned int _unused : 23; /* This is the protocol supported by this key. */ gpgme_protocol_t protocol; diff --git a/gpgme/keylist.c b/gpgme/keylist.c index c47f386..07c9385 100644 --- a/gpgme/keylist.c +++ b/gpgme/keylist.c @@ -245,6 +245,10 @@ set_mainkey_capability (gpgme_key_t key, const char *src) key->subkeys->can_certify = 1; break; + case 'a': + key->subkeys->can_authenticate = 1; + break; + case 'd': case 'D': /* 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': key->can_certify = 1; break; + + case 'A': + key->can_authenticate = 1; + break; } src++; } @@ -290,6 +298,10 @@ set_subkey_capability (gpgme_subkey_t subkey, const char *src) case 'c': subkey->can_certify = 1; break; + + case 'a': + subkey->can_authenticate = 1; + break; } src++; } -- 2.26.2