mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
removed g10maint.c
This commit is contained in:
parent
0eb5aa6cfd
commit
1b1a6d7e77
12 changed files with 571 additions and 810 deletions
29
g10/getkey.c
29
g10/getkey.c
|
@ -323,6 +323,8 @@ get_pubkey_byname( PKT_public_cert *pkc, const char *name )
|
|||
int i;
|
||||
char buf[9];
|
||||
|
||||
if( *s == '0' && s[1] == 'x' && isxdigit(s[2]) )
|
||||
s += 2; /*kludge to allow 0x034343434 */
|
||||
for(i=0; isxdigit(s[i]); i++ )
|
||||
;
|
||||
if( s[i] && !isspace(s[i]) ) /* not terminated by EOS or blank*/
|
||||
|
@ -418,6 +420,33 @@ get_seckey( PKT_secret_cert *skc, u32 *keyid )
|
|||
return rc;
|
||||
}
|
||||
|
||||
/****************
|
||||
* Check wether the secret key is available
|
||||
* Returns: 0 := key is available
|
||||
* G10ERR_NO_SECKEY := not availabe
|
||||
*/
|
||||
int
|
||||
seckey_available( u32 *keyid )
|
||||
{
|
||||
PKT_secret_cert *skc;
|
||||
STRLIST sl;
|
||||
int rc=0;
|
||||
|
||||
skc = m_alloc_clear( sizeof *skc );
|
||||
for(sl = secret_keyrings; sl; sl = sl->next )
|
||||
if( !(rc=scan_secret_keyring( skc, keyid, NULL, sl->d )) )
|
||||
goto found;
|
||||
/* fixme: look at other places */
|
||||
goto leave;
|
||||
|
||||
found:
|
||||
leave:
|
||||
free_secret_cert( skc );
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/****************
|
||||
* Get a secret key by name and store it into skc
|
||||
* If NAME is NULL use the default certificate
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue