aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/algo_factory/algo_factory.h5
-rw-r--r--src/build-data/buildh.in13
-rw-r--r--src/cert/x509cert/x509_obj.h1
-rw-r--r--src/libstate/look_pk.h7
-rw-r--r--src/pubkey/pkcs8.h2
-rw-r--r--src/pubkey/x509_key.h1
6 files changed, 25 insertions, 4 deletions
diff --git a/src/algo_factory/algo_factory.h b/src/algo_factory/algo_factory.h
index 1c865b470..10549d5d3 100644
--- a/src/algo_factory/algo_factory.h
+++ b/src/algo_factory/algo_factory.h
@@ -162,7 +162,7 @@ class BOTAN_DLL Algorithm_Factory
/**
* An iterator for the engines in this factory
- * @deprecated
+ * @deprecated Avoid in new code
*/
class BOTAN_DLL Engine_Iterator
{
@@ -175,7 +175,8 @@ class BOTAN_DLL Algorithm_Factory
/**
* @param a an algorithm factory
*/
- Engine_Iterator(const Algorithm_Factory& a) : af(a) { n = 0; }
+ Engine_Iterator(const Algorithm_Factory& a) :
+ af(a) { n = 0; }
private:
const Algorithm_Factory& af;
size_t n;
diff --git a/src/build-data/buildh.in b/src/build-data/buildh.in
index 03f8b8f2e..53c66e133 100644
--- a/src/build-data/buildh.in
+++ b/src/build-data/buildh.in
@@ -57,12 +57,23 @@
%{target_compiler_defines}
-#if defined(BOTAN_BUILD_COMPILER_IS_MSVC)
+#if defined(_MSC_VER)
// 4250: inherits via dominance (diamond inheritence issue)
// 4251: needs DLL interface (STL DLL exports)
#pragma warning(disable: 4250 4251)
#endif
+/*
+* Compile-time deprecatation warnings
+*/
+#if defined(__GNUG__)
+ #define BOTAN_DEPRECATED(msg) __attribute__ ((deprecated, warning(why)))
+#elif defined(_MSC_VER)
+ #define BOTAN_DEPRECATED(msg) __declspec(deprecated(why))
+#else
+ #define BOTAN_DEPRECATED(msg)
+#endif
+
/* Module definitions */
%{module_defines}
diff --git a/src/cert/x509cert/x509_obj.h b/src/cert/x509cert/x509_obj.h
index 6579565f9..570b00f51 100644
--- a/src/cert/x509cert/x509_obj.h
+++ b/src/cert/x509cert/x509_obj.h
@@ -88,6 +88,7 @@ class BOTAN_DLL X509_Object
* @param out the pipe to write to
* @param encoding the encoding to use
*/
+ BOTAN_DEPRECATED("Use BER_encode or PEM_encode")
void encode(Pipe& out, X509_Encoding encoding = PEM) const;
virtual ~X509_Object() {}
diff --git a/src/libstate/look_pk.h b/src/libstate/look_pk.h
index c980e5f8d..bbd0e7dba 100644
--- a/src/libstate/look_pk.h
+++ b/src/libstate/look_pk.h
@@ -21,6 +21,7 @@ namespace Botan {
* @param eme determines the algorithm and encoding
* @return public key encryptor object
*/
+BOTAN_DEPRECATED("Instantiate object directly")
inline PK_Encryptor* get_pk_encryptor(const Public_Key& key,
const std::string& eme)
{
@@ -35,6 +36,7 @@ inline PK_Encryptor* get_pk_encryptor(const Public_Key& key,
* @param eme determines the algorithm and encoding
* @return public key decryptor object
*/
+BOTAN_DEPRECATED("Instantiate object directly")
inline PK_Decryptor* get_pk_decryptor(const Private_Key& key,
const std::string& eme)
{
@@ -50,6 +52,7 @@ inline PK_Decryptor* get_pk_decryptor(const Private_Key& key,
* @param sig_format the signature format to be used
* @return public key signer object
*/
+BOTAN_DEPRECATED("Instantiate object directly")
inline PK_Signer* get_pk_signer(const Private_Key& key,
const std::string& emsa,
Signature_Format sig_format = IEEE_1363)
@@ -66,6 +69,7 @@ inline PK_Signer* get_pk_signer(const Private_Key& key,
* @param sig_format the signature format to be used
* @return public key verifier object
*/
+BOTAN_DEPRECATED("Instantiate object directly")
inline PK_Verifier* get_pk_verifier(const Public_Key& key,
const std::string& emsa,
Signature_Format sig_format = IEEE_1363)
@@ -81,8 +85,9 @@ inline PK_Verifier* get_pk_verifier(const Public_Key& key,
* @param kdf the kdf algorithm to use
* @return key agreement algorithm
*/
+BOTAN_DEPRECATED("Instantiate object directly")
inline PK_Key_Agreement* get_pk_kas(const PK_Key_Agreement_Key& key,
- const std::string& kdf)
+ const std::string& kdf)
{
return new PK_Key_Agreement(key, kdf);
}
diff --git a/src/pubkey/pkcs8.h b/src/pubkey/pkcs8.h
index 376429d5b..00607b329 100644
--- a/src/pubkey/pkcs8.h
+++ b/src/pubkey/pkcs8.h
@@ -81,6 +81,7 @@ BOTAN_DLL std::string PEM_encode(const Private_Key& key,
* @param pipe the pipe to feed the encoded key into
* @param encoding the encoding type to use
*/
+BOTAN_DEPRECATED("Use PEM_encode or BER_encode")
inline void encode(const Private_Key& key,
Pipe& pipe,
X509_Encoding encoding = PEM)
@@ -104,6 +105,7 @@ inline void encode(const Private_Key& key,
default will be chosen.
* @param encoding the encoding type to use
*/
+BOTAN_DEPRECATED("Use PEM_encode or BER_encode")
inline void encrypt_key(const Private_Key& key,
Pipe& pipe,
RandomNumberGenerator& rng,
diff --git a/src/pubkey/x509_key.h b/src/pubkey/x509_key.h
index 7dd2a9db8..3fdee8cde 100644
--- a/src/pubkey/x509_key.h
+++ b/src/pubkey/x509_key.h
@@ -83,6 +83,7 @@ BOTAN_DLL Key_Constraints find_constraints(const Public_Key& pub_key,
* @param pipe the pipe to feed the encoded key into
* @param encoding the encoding type to use
*/
+BOTAN_DEPRECATED("Use PEM_encode or BER_encode")
inline void encode(const Public_Key& key,
Pipe& pipe,
X509_Encoding encoding = PEM)