diff options
author | lloyd <[email protected]> | 2010-03-08 14:28:14 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-03-08 14:28:14 +0000 |
commit | ea38a42c2cfbc3a6235b11637b382589676c6286 (patch) | |
tree | 918b28ec50e98612e2c055e28368f7397b96f79c /src/pubkey | |
parent | 3900bd1e5a9974eea4faee4a8159380ea67c6251 (diff) |
Remove the now no-op classes PK_Encrypting_Key,
PK_Decrypting_Key, PK_Signing_Key, PK_Verifying_with_MR_Key, and
PK_Verifying_wo_MR_Key.
Diffstat (limited to 'src/pubkey')
-rw-r--r-- | src/pubkey/dsa/dsa.h | 4 | ||||
-rw-r--r-- | src/pubkey/ecdsa/ecdsa.h | 6 | ||||
-rw-r--r-- | src/pubkey/elgamal/elgamal.h | 4 | ||||
-rw-r--r-- | src/pubkey/gost_3410/gost_3410.h | 6 | ||||
-rw-r--r-- | src/pubkey/info.txt | 2 | ||||
-rw-r--r-- | src/pubkey/nr/nr.h | 4 | ||||
-rw-r--r-- | src/pubkey/pk_keys.h | 35 | ||||
-rw-r--r-- | src/pubkey/pk_ops.h | 8 | ||||
-rw-r--r-- | src/pubkey/rsa/rsa.h | 6 | ||||
-rw-r--r-- | src/pubkey/rw/rw.h | 4 | ||||
-rw-r--r-- | src/pubkey/x509_key.cpp | 15 |
11 files changed, 23 insertions, 71 deletions
diff --git a/src/pubkey/dsa/dsa.h b/src/pubkey/dsa/dsa.h index 290cb5740..a57cbfcae 100644 --- a/src/pubkey/dsa/dsa.h +++ b/src/pubkey/dsa/dsa.h @@ -18,8 +18,7 @@ namespace Botan { /* * DSA Public Key */ -class BOTAN_DLL DSA_PublicKey : public PK_Verifying_wo_MR_Key, - public virtual DL_Scheme_PublicKey +class BOTAN_DLL DSA_PublicKey : public virtual DL_Scheme_PublicKey { public: std::string algo_name() const { return "DSA"; } @@ -44,7 +43,6 @@ class BOTAN_DLL DSA_PublicKey : public PK_Verifying_wo_MR_Key, * DSA Private Key */ class BOTAN_DLL DSA_PrivateKey : public DSA_PublicKey, - public PK_Signing_Key, public virtual DL_Scheme_PrivateKey { public: diff --git a/src/pubkey/ecdsa/ecdsa.h b/src/pubkey/ecdsa/ecdsa.h index 9e457a0a7..7ea135896 100644 --- a/src/pubkey/ecdsa/ecdsa.h +++ b/src/pubkey/ecdsa/ecdsa.h @@ -18,8 +18,7 @@ namespace Botan { /** * This class represents ECDSA Public Keys. */ -class BOTAN_DLL ECDSA_PublicKey : public virtual EC_PublicKey, - public PK_Verifying_wo_MR_Key +class BOTAN_DLL ECDSA_PublicKey : public virtual EC_PublicKey { public: @@ -62,8 +61,7 @@ class BOTAN_DLL ECDSA_PublicKey : public virtual EC_PublicKey, * This class represents ECDSA Private Keys */ class BOTAN_DLL ECDSA_PrivateKey : public ECDSA_PublicKey, - public EC_PrivateKey, - public PK_Signing_Key + public EC_PrivateKey { public: diff --git a/src/pubkey/elgamal/elgamal.h b/src/pubkey/elgamal/elgamal.h index 238f286e7..dad9dbc3e 100644 --- a/src/pubkey/elgamal/elgamal.h +++ b/src/pubkey/elgamal/elgamal.h @@ -18,8 +18,7 @@ namespace Botan { /* * ElGamal Public Key */ -class BOTAN_DLL ElGamal_PublicKey : public PK_Encrypting_Key, - public virtual DL_Scheme_PublicKey +class BOTAN_DLL ElGamal_PublicKey : public virtual DL_Scheme_PublicKey { public: std::string algo_name() const { return "ElGamal"; } @@ -41,7 +40,6 @@ class BOTAN_DLL ElGamal_PublicKey : public PK_Encrypting_Key, * ElGamal Private Key */ class BOTAN_DLL ElGamal_PrivateKey : public ElGamal_PublicKey, - public PK_Decrypting_Key, public virtual DL_Scheme_PrivateKey { public: diff --git a/src/pubkey/gost_3410/gost_3410.h b/src/pubkey/gost_3410/gost_3410.h index d3309b8f1..ffdbc6e19 100644 --- a/src/pubkey/gost_3410/gost_3410.h +++ b/src/pubkey/gost_3410/gost_3410.h @@ -18,8 +18,7 @@ namespace Botan { /** * This class represents GOST_3410 Public Keys. */ -class BOTAN_DLL GOST_3410_PublicKey : public virtual EC_PublicKey, - public PK_Verifying_wo_MR_Key +class BOTAN_DLL GOST_3410_PublicKey : public virtual EC_PublicKey { public: @@ -69,8 +68,7 @@ class BOTAN_DLL GOST_3410_PublicKey : public virtual EC_PublicKey, * This class represents GOST_3410 Private Keys */ class BOTAN_DLL GOST_3410_PrivateKey : public GOST_3410_PublicKey, - public EC_PrivateKey, - public PK_Signing_Key + public EC_PrivateKey { public: diff --git a/src/pubkey/info.txt b/src/pubkey/info.txt index 01378b856..a4a5bfc71 100644 --- a/src/pubkey/info.txt +++ b/src/pubkey/info.txt @@ -28,8 +28,10 @@ workfactor.h alloc asn1 bigint +engine filters kdf +libstate oid_lookup pbe pem diff --git a/src/pubkey/nr/nr.h b/src/pubkey/nr/nr.h index ba7cee8cc..19eac5cc9 100644 --- a/src/pubkey/nr/nr.h +++ b/src/pubkey/nr/nr.h @@ -18,8 +18,7 @@ namespace Botan { /* * Nyberg-Rueppel Public Key */ -class BOTAN_DLL NR_PublicKey : public PK_Verifying_with_MR_Key, - public virtual DL_Scheme_PublicKey +class BOTAN_DLL NR_PublicKey : public virtual DL_Scheme_PublicKey { public: std::string algo_name() const { return "NR"; } @@ -42,7 +41,6 @@ class BOTAN_DLL NR_PublicKey : public PK_Verifying_with_MR_Key, * Nyberg-Rueppel Private Key */ class BOTAN_DLL NR_PrivateKey : public NR_PublicKey, - public PK_Signing_Key, public virtual DL_Scheme_PrivateKey { public: diff --git a/src/pubkey/pk_keys.h b/src/pubkey/pk_keys.h index 74e36c638..da73db0ee 100644 --- a/src/pubkey/pk_keys.h +++ b/src/pubkey/pk_keys.h @@ -100,41 +100,6 @@ class BOTAN_DLL Private_Key : public virtual Public_Key }; /** -* PK Encrypting Key. -*/ -class BOTAN_DLL PK_Encrypting_Key : public virtual Public_Key - { - }; - -/** -* PK Decrypting Key -*/ -class BOTAN_DLL PK_Decrypting_Key : public virtual Private_Key - { - }; - -/** -* PK Signing Key -*/ -class BOTAN_DLL PK_Signing_Key : public virtual Private_Key - { - }; - -/** -* PK Verifying Key, Message Recovery Version -*/ -class BOTAN_DLL PK_Verifying_with_MR_Key : public virtual Public_Key - { - }; - -/** -* PK Verifying Key, No Message Recovery Version -*/ -class BOTAN_DLL PK_Verifying_wo_MR_Key : public virtual Public_Key - { - }; - -/** * PK Secret Value Derivation Key */ class BOTAN_DLL PK_Key_Agreement_Key : public virtual Private_Key diff --git a/src/pubkey/pk_ops.h b/src/pubkey/pk_ops.h index 3f04b52dc..bf846d69f 100644 --- a/src/pubkey/pk_ops.h +++ b/src/pubkey/pk_ops.h @@ -106,8 +106,8 @@ class BOTAN_DLL Verification * @param sig_len the length of sig in bytes * @returns if signature is a valid one for message */ - virtual bool verify(const byte msg[], u32bit msg_len, - const byte sig[], u32bit sig_len) const + virtual bool verify(const byte[], u32bit, + const byte[], u32bit) const { throw Invalid_State("Message recovery required"); } @@ -119,8 +119,8 @@ class BOTAN_DLL Verification * @param msg_len the length of msg in bytes * @returns recovered message */ - virtual SecureVector<byte> verify_mr(const byte msg[], - u32bit msg_len) const + virtual SecureVector<byte> verify_mr(const byte[], + u32bit) const { throw Invalid_State("Message recovery not supported"); } diff --git a/src/pubkey/rsa/rsa.h b/src/pubkey/rsa/rsa.h index f91d807f4..cf81e0f3b 100644 --- a/src/pubkey/rsa/rsa.h +++ b/src/pubkey/rsa/rsa.h @@ -16,9 +16,7 @@ namespace Botan { /** * RSA Public Key */ -class BOTAN_DLL RSA_PublicKey : public PK_Encrypting_Key, - public PK_Verifying_with_MR_Key, - public virtual IF_Scheme_PublicKey +class BOTAN_DLL RSA_PublicKey : public virtual IF_Scheme_PublicKey { public: std::string algo_name() const { return "RSA"; } @@ -49,8 +47,6 @@ class BOTAN_DLL RSA_PublicKey : public PK_Encrypting_Key, * RSA Private Key class. */ class BOTAN_DLL RSA_PrivateKey : public RSA_PublicKey, - public PK_Decrypting_Key, - public PK_Signing_Key, public IF_Scheme_PrivateKey { public: diff --git a/src/pubkey/rw/rw.h b/src/pubkey/rw/rw.h index 7d614cf5a..8ca8d18b0 100644 --- a/src/pubkey/rw/rw.h +++ b/src/pubkey/rw/rw.h @@ -16,8 +16,7 @@ namespace Botan { /* * Rabin-Williams Public Key */ -class BOTAN_DLL RW_PublicKey : public PK_Verifying_with_MR_Key, - public virtual IF_Scheme_PublicKey +class BOTAN_DLL RW_PublicKey : public virtual IF_Scheme_PublicKey { public: std::string algo_name() const { return "RW"; } @@ -39,7 +38,6 @@ class BOTAN_DLL RW_PublicKey : public PK_Verifying_with_MR_Key, * Rabin-Williams Private Key */ class BOTAN_DLL RW_PrivateKey : public RW_PublicKey, - public PK_Signing_Key, public IF_Scheme_PrivateKey { public: diff --git a/src/pubkey/x509_key.cpp b/src/pubkey/x509_key.cpp index aaea8c943..babeb517f 100644 --- a/src/pubkey/x509_key.cpp +++ b/src/pubkey/x509_key.cpp @@ -129,17 +129,18 @@ Public_Key* copy_key(const Public_Key& key) Key_Constraints find_constraints(const Public_Key& pub_key, Key_Constraints limits) { - const Public_Key* key = &pub_key; - u32bit constraints = 0; + const std::string name = pub_key.algo_name(); - if(dynamic_cast<const PK_Encrypting_Key*>(key)) - constraints |= KEY_ENCIPHERMENT | DATA_ENCIPHERMENT; + u32bit constraints = 0; - if(dynamic_cast<const PK_Key_Agreement_Key*>(key)) + if(name == "DH" || name == "ECDH") constraints |= KEY_AGREEMENT; - if(dynamic_cast<const PK_Verifying_wo_MR_Key*>(key) || - dynamic_cast<const PK_Verifying_with_MR_Key*>(key)) + if(name == "RSA" || name == "ElGamal") + constraints |= KEY_ENCIPHERMENT | DATA_ENCIPHERMENT; + + if(name == "RSA" || name == "RW" || name == "NR" || + name == "DSA" || name == "ECDSA") constraints |= DIGITAL_SIGNATURE | NON_REPUDIATION; if(limits) |