aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/asn1
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>1999-01-02 01:53:06 +0000
committerDr. Stephen Henson <steve@openssl.org>1999-01-02 01:53:06 +0000
commitc35f549e8be6e3ceaf5bfc2536103d763234135b (patch)
tree0653fc5e9df6d405e11ecf0dc4830729b8b1b319 /crypto/asn1
parentebc828cad9e3b95723a123548becad832e0d0fc8 (diff)
downloadopenssl-c35f549e8be6e3ceaf5bfc2536103d763234135b.tar.gz
Move DSA test in ca.c inside #ifdef and make pubkey BIT STRING always have
zero unused bits.
Diffstat (limited to 'crypto/asn1')
-rw-r--r--crypto/asn1/x_pubkey.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/crypto/asn1/x_pubkey.c b/crypto/asn1/x_pubkey.c
index b8e6d0e00e..200817bf5b 100644
--- a/crypto/asn1/x_pubkey.c
+++ b/crypto/asn1/x_pubkey.c
@@ -188,6 +188,10 @@ EVP_PKEY *pkey;
p=s;
i2d_PublicKey(pkey,&p);
if (!ASN1_BIT_STRING_set(pk->public_key,s,i)) goto err;
+ /* Set number of unused bits to zero */
+ pk->public_key->flags&= ~(ASN1_STRING_FLAG_BITS_LEFT|0x07);
+ pk->public_key->flags|=ASN1_STRING_FLAG_BITS_LEFT;
+
Free(s);
CRYPTO_add(&pkey->references,1,CRYPTO_LOCK_EVP_PKEY);