make sure RSA blinding works when the PRNG is not properly seeded;
[openssl.git] / crypto / rsa / rsa.h
index cdf514c00945e1a6530654b97909ff705665acee..604fc26442740a93729275bc0831851acc18b633 100644 (file)
@@ -114,7 +114,11 @@ typedef struct rsa_meth_st
        int (*rsa_verify)(int dtype,
                const unsigned char *m, unsigned int m_length,
                unsigned char *sigbuf, unsigned int siglen, const RSA *rsa);
-
+/* If this callback is NULL, the builtin software RSA key-gen will be used. This
+ * is for behavioural compatibility whilst the code gets rewired, but one day
+ * it would be nice to assume there are no such things as "builtin software"
+ * implementations. */
+       int (*rsa_keygen)(RSA *rsa, int bits, unsigned long e, BN_GENCB *cb);
        } RSA_METHOD;
 
 struct rsa_st
@@ -158,6 +162,11 @@ struct rsa_st
 #define RSA_FLAG_CACHE_PUBLIC          0x02
 #define RSA_FLAG_CACHE_PRIVATE         0x04
 #define RSA_FLAG_BLINDING              0x08
+#define RSA_FLAG_NO_BLINDING           0x80 /* new with 0.9.6j and 0.9.7b; the built-in
+                                              * RSA implementation now uses blinding by
+                                              * default (ignoring RSA_FLAG_BLINDING),
+                                              * but other engines might not need it
+                                              */
 #define RSA_FLAG_THREAD_SAFE           0x10
 /* This flag means the private key operations will be handled by rsa_mod_exp
  * and that they do not depend on the private key components being present:
@@ -170,6 +179,8 @@ struct rsa_st
  */
 #define RSA_FLAG_SIGN_VER              0x40
 
+#define RSA_FLAG_NO_BLINDING           0x80
+
 #define RSA_PKCS1_PADDING      1
 #define RSA_SSLV23_PADDING     2
 #define RSA_NO_PADDING         3