summaryrefslogtreecommitdiffstats
path: root/g10/getkey.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>1999-11-13 17:43:23 +0100
committerWerner Koch <wk@gnupg.org>1999-11-13 17:43:23 +0100
commit881e51323749ba797202d8a4119910e6f9d2f727 (patch)
tree3de535d07143b9b3513b524dd81f32a5305756b1 /g10/getkey.c
parentSee ChangeLog: Thu Oct 28 16:17:46 CEST 1999 Werner Koch (diff)
downloadgnupg2-881e51323749ba797202d8a4119910e6f9d2f727.tar.xz
gnupg2-881e51323749ba797202d8a4119910e6f9d2f727.zip
See ChangeLog: Sat Nov 13 17:44:23 CET 1999 Werner Koch
Diffstat (limited to 'g10/getkey.c')
-rw-r--r--g10/getkey.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/g10/getkey.c b/g10/getkey.c
index fb5f1bc3e..a94b5de48 100644
--- a/g10/getkey.c
+++ b/g10/getkey.c
@@ -24,6 +24,7 @@
#include <string.h>
#include <assert.h>
#include <ctype.h>
+#include <gcrypt.h>
#include "util.h"
#include "packet.h"
#include "memory.h"
@@ -185,7 +186,7 @@ cache_public_key( PKT_public_key *pk )
return;
if( is_ELGAMAL(pk->pubkey_algo)
- || pk->pubkey_algo == PUBKEY_ALGO_DSA
+ || pk->pubkey_algo == GCRY_PK_DSA
|| is_RSA(pk->pubkey_algo) ) {
keyid_from_pk( pk, keyid );
}
@@ -1269,7 +1270,7 @@ find_by_name( KBNODE keyblock, PKT_public_key *pk, const char *name,
|| pk->pubkey_algo
== kk->pkt->pkt.public_key->pubkey_algo)
&& ( !pk->pubkey_usage
- || !check_pubkey_algo2(
+ || !openpgp_pk_test_algo(
kk->pkt->pkt.public_key->pubkey_algo,
pk->pubkey_usage ))
)
@@ -1279,7 +1280,7 @@ find_by_name( KBNODE keyblock, PKT_public_key *pk, const char *name,
u32 aki[2];
keyid_from_pk( kk->pkt->pkt.public_key, aki );
cache_user_id( k->pkt->pkt.user_id, aki );
- rmd160_hash_buffer( namehash,
+ gcry_md_hash_buffer( GCRY_MD_RMD160, namehash,
k->pkt->pkt.user_id->name,
k->pkt->pkt.user_id->len );
*use_namehash = 1;
@@ -1312,7 +1313,7 @@ find_by_name_sk( KBNODE keyblock, PKT_secret_key *sk, const char *name,
|| sk->pubkey_algo
== kk->pkt->pkt.secret_key->pubkey_algo)
&& ( !sk->pubkey_usage
- || !check_pubkey_algo2(
+ || !openpgp_pk_test_algo(
kk->pkt->pkt.secret_key->pubkey_algo,
sk->pubkey_usage ))
)
@@ -1530,7 +1531,7 @@ finish_lookup( KBNODE keyblock, PKT_public_key *pk, KBNODE k, byte *namehash,
}
else {
if( primary && pk->pubkey_usage
- && check_pubkey_algo2( k->pkt->pkt.public_key->pubkey_algo,
+ && openpgp_pk_test_algo( k->pkt->pkt.public_key->pubkey_algo,
pk->pubkey_usage ) == G10ERR_WR_PUBKEY_ALGO ) {
/* if the usage is not correct, try to use a subkey */
KBNODE save_k = k;
@@ -1538,12 +1539,12 @@ finish_lookup( KBNODE keyblock, PKT_public_key *pk, KBNODE k, byte *namehash,
k = NULL;
/* kludge for pgp 5: which doesn't accept type 20:
* try to use a type 16 subkey instead */
- if( pk->pubkey_usage == PUBKEY_USAGE_ENC ) {
+ if( pk->pubkey_usage == GCRY_PK_USAGE_ENCR ) {
for( k = save_k; k; k = k->next ) {
if( k->pkt->pkttype == PKT_PUBLIC_SUBKEY
&& k->pkt->pkt.public_key->pubkey_algo
- == PUBKEY_ALGO_ELGAMAL_E
- && !check_pubkey_algo2(
+ == GCRY_PK_ELG_E
+ && !openpgp_pk_test_algo(
k->pkt->pkt.public_key->pubkey_algo,
pk->pubkey_usage ) )
break;
@@ -1553,7 +1554,7 @@ finish_lookup( KBNODE keyblock, PKT_public_key *pk, KBNODE k, byte *namehash,
if( !k ) {
for(k = save_k ; k; k = k->next ) {
if( k->pkt->pkttype == PKT_PUBLIC_SUBKEY
- && !check_pubkey_algo2(
+ && !openpgp_pk_test_algo(
k->pkt->pkt.public_key->pubkey_algo,
pk->pubkey_usage ) )
break;
@@ -1586,7 +1587,7 @@ finish_lookup_sk( KBNODE keyblock, PKT_secret_key *sk, KBNODE k, int primary )
}
else {
if( primary && sk->pubkey_usage
- && check_pubkey_algo2( k->pkt->pkt.secret_key->pubkey_algo,
+ && openpgp_pk_test_algo( k->pkt->pkt.secret_key->pubkey_algo,
sk->pubkey_usage ) == G10ERR_WR_PUBKEY_ALGO ) {
/* if the usage is not correct, try to use a subkey */
KBNODE save_k = k;
@@ -1594,12 +1595,12 @@ finish_lookup_sk( KBNODE keyblock, PKT_secret_key *sk, KBNODE k, int primary )
k = NULL;
/* kludge for pgp 5: which doesn't accept type 20:
* try to use a type 16 subkey instead */
- if( sk->pubkey_usage == PUBKEY_USAGE_ENC ) {
+ if( sk->pubkey_usage == GCRY_PK_USAGE_ENCR ) {
for( k = save_k; k; k = k->next ) {
if( k->pkt->pkttype == PKT_SECRET_SUBKEY
&& k->pkt->pkt.secret_key->pubkey_algo
- == PUBKEY_ALGO_ELGAMAL_E
- && !check_pubkey_algo2(
+ == GCRY_PK_ELG_E
+ && !openpgp_pk_test_algo(
k->pkt->pkt.secret_key->pubkey_algo,
sk->pubkey_usage ) )
break;
@@ -1609,7 +1610,7 @@ finish_lookup_sk( KBNODE keyblock, PKT_secret_key *sk, KBNODE k, int primary )
if( !k ) {
for(k = save_k ; k; k = k->next ) {
if( k->pkt->pkttype == PKT_SECRET_SUBKEY
- && !check_pubkey_algo2(
+ && !openpgp_pk_test_algo(
k->pkt->pkt.secret_key->pubkey_algo,
sk->pubkey_usage ) )
break;