Check GOST parameters are not NULL (CVE-2012-0027)
[oweals/openssl.git] / engines / ccgost / gost_lcl.h
index 7996db569b7d0f92daee34469392e6aeaba6c685..437a48cc86ca65736edda3b4a2477935dbe68798 100644 (file)
@@ -47,6 +47,7 @@
            int sign_param_nid; /* Should be set whenever parameters are filled */
                EVP_MD *md;
                unsigned char *shared_ukm;
+               int peer_key_used;
        };
 
        struct gost_mac_pmeth_data {
@@ -83,6 +84,22 @@ typedef struct { /* FIXME incomplete */
        GOST_KEY_TRANSPORT *gkt;
 } GOST_CLIENT_KEY_EXCHANGE_PARAMS;
 
+/* Hacks to shorten symbols to 31 characters or less, or OpenVMS.
+   This mimics what's done in symhacks.h, but since this is a very
+   local header file, I prefered to put this hack directly here.
+   -- Richard Levitte */
+#ifdef OPENSSL_SYS_VMS
+#undef GOST_CLIENT_KEY_EXCHANGE_PARAMS_it
+#define GOST_CLIENT_KEY_EXCHANGE_PARAMS_it     GOST_CLIENT_KEY_EXC_PARAMS_it
+#undef GOST_CLIENT_KEY_EXCHANGE_PARAMS_new
+#define GOST_CLIENT_KEY_EXCHANGE_PARAMS_new    GOST_CLIENT_KEY_EXC_PARAMS_new
+#undef GOST_CLIENT_KEY_EXCHANGE_PARAMS_free
+#define GOST_CLIENT_KEY_EXCHANGE_PARAMS_free   GOST_CLIENT_KEY_EXC_PARAMS_free
+#undef d2i_GOST_CLIENT_KEY_EXCHANGE_PARAMS
+#define d2i_GOST_CLIENT_KEY_EXCHANGE_PARAMS    d2i_GOST_CLIENT_KEY_EXC_PARAMS
+#undef i2d_GOST_CLIENT_KEY_EXCHANGE_PARAMS
+#define i2d_GOST_CLIENT_KEY_EXCHANGE_PARAMS    i2d_GOST_CLIENT_KEY_EXC_PARAMS
+#endif /* End of hack */
 DECLARE_ASN1_FUNCTIONS(GOST_CLIENT_KEY_EXCHANGE_PARAMS)
 typedef struct {
        ASN1_OBJECT *key_params;