aboutsummaryrefslogtreecommitdiffstats
path: root/cipher/pubkey.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>1998-07-06 10:23:57 +0000
committerWerner Koch <[email protected]>1998-07-06 10:23:57 +0000
commita9ec668cbe5b3335f5db0f05b8e9e88e29ada52c (patch)
treee159c79b615fcdcb65f31ee5d1d0a2b1ba84e9aa /cipher/pubkey.c
parentpartly added creation of OP partial length headers (diff)
downloadgnupg-a9ec668cbe5b3335f5db0f05b8e9e88e29ada52c.tar.gz
gnupg-a9ec668cbe5b3335f5db0f05b8e9e88e29ada52c.zip
intermediate release
Diffstat (limited to 'cipher/pubkey.c')
-rw-r--r--cipher/pubkey.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/cipher/pubkey.c b/cipher/pubkey.c
index f59996c4d..a78f788c0 100644
--- a/cipher/pubkey.c
+++ b/cipher/pubkey.c
@@ -282,9 +282,11 @@ check_pubkey_algo2( int algo, unsigned usage )
do {
for(i=0; pubkey_table[i].name; i++ )
if( pubkey_table[i].algo == algo ) {
- if( (usage & 1) && !(pubkey_table[i].usage & 1) )
+ if( (usage & PUBKEY_USAGE_SIG)
+ && !(pubkey_table[i].usage & PUBKEY_USAGE_SIG) )
return G10ERR_WR_PUBKEY_ALGO;
- if( (usage & 2) && !(pubkey_table[i].usage & 2) )
+ if( (usage & PUBKEY_USAGE_ENC)
+ && !(pubkey_table[i].usage & PUBKEY_USAGE_ENC) )
return G10ERR_WR_PUBKEY_ALGO;
return 0; /* okay */
}