Change #include filenames from <foo.h> to <openssl.h>.
[openssl.git] / crypto / dh / dh_lib.c
index a83c97287e13109fe5b8c1158bed106c81de20b2..61e0720e8a7960bceba032b0b000945004eb44d5 100644 (file)
 
 #include <stdio.h>
 #include "cryptlib.h"
-#include "bn.h"
-#include "dh.h"
+#include <openssl/bn.h>
+#include <openssl/dh.h>
 
-char *DH_version="Diffie-Hellman part of OpenSSL 0.9.2 31-Dec-1998";
+const char *DH_version="Diffie-Hellman" OPENSSL_VERSION_PTEXT;
 
-DH *DH_new()
+DH *DH_new(void)
        {
        DH *ret;
 
@@ -85,9 +85,9 @@ DH *DH_new()
        return(ret);
        }
 
-void DH_free(r)
-DH *r;
+void DH_free(DH *r)
        {
+       if(r == NULL) return;
        if (r->p != NULL) BN_clear_free(r->p);
        if (r->g != NULL) BN_clear_free(r->g);
        if (r->pub_key != NULL) BN_clear_free(r->pub_key);
@@ -97,8 +97,7 @@ DH *r;
        Free(r);
        }
 
-int DH_size(dh)
-DH *dh;
+int DH_size(DH *dh)
        {
        return(BN_num_bytes(dh->p));
        }