Check GOST parameters are not NULL (CVE-2012-0027)
[oweals/openssl.git] / engines / ccgost / gost_lcl.h
index 6a67f05123fc56e5cd344ff28af5f79fbbb84f11..437a48cc86ca65736edda3b4a2477935dbe68798 100644 (file)
@@ -16,7 +16,6 @@
 #include <openssl/x509.h>
 #include <openssl/engine.h>
 #include <openssl/ec.h>
-#include <unistd.h>
 #include "gost89.h"
 #include "gosthash.h"
 /* Control commands */
@@ -48,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 {
@@ -84,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;