Commit e527201f authored by Andy Polyakov's avatar Andy Polyakov
Browse files

This _WIN32-specific patch makes it possible to "wrap" OpenSSL in another

.DLL, in particular static build. The issue has been discussed in RT#1230
and later on openssl-dev, and mutually exclusive approaches were suggested.
This completes compromise solution suggested in RT#1230.
PR: 1230
parent 70531c14
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -279,7 +279,7 @@ static long MS_CALLBACK file_ctrl(BIO *b, int cmd, long num, void *ptr)
#endif
		{
#if defined(OPENSSL_SYS_WINDOWS)
		int fd = fileno((FILE*)ptr);
		int fd = _fileno((FILE*)ptr);
		if (num & BIO_FP_TEXT)
			_setmode(fd,_O_TEXT);
		else
+4 −0
Original line number Diff line number Diff line
@@ -150,7 +150,11 @@ int DES_enc_read(int fd, void *buf, int len, DES_key_schedule *sched,
	/* first - get the length */
	while (net_num < HDRSIZE) 
		{
#ifndef _WIN32
		i=read(fd,(void *)&(net[net_num]),HDRSIZE-net_num);
#else
		i=_read(fd,(void *)&(net[net_num]),HDRSIZE-net_num);
#endif
#ifdef EINTR
		if ((i == -1) && (errno == EINTR)) continue;
#endif
+4 −0
Original line number Diff line number Diff line
@@ -156,7 +156,11 @@ int DES_enc_write(int fd, const void *_buf, int len,
		{
		/* eay 26/08/92 I was not doing writing from where we
		 * got up to. */
#ifndef _WIN32
		i=write(fd,(void *)&(outbuf[j]),outnum-j);
#else
		i=_write(fd,(void *)&(outbuf[j]),outnum-j);
#endif
		if (i == -1)
			{
#ifdef EINTR
+2 −1
Original line number Diff line number Diff line
@@ -56,11 +56,12 @@
 *
 */

#include <openssl/asn1.h>
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include "e_os.h"
#include <openssl/asn1.h>
#include <openssl/ocsp.h>
#include <openssl/err.h>
#include <openssl/buffer.h>
+7 −0
Original line number Diff line number Diff line
@@ -79,6 +79,13 @@
# include <sys/stat.h>
#endif

#ifdef _WIN32
#define stat	_stat
#define chmod	_chmod
#define open	_open
#define fdopen	_fdopen
#endif

#undef BUFSIZE
#define BUFSIZE	1024
#define RAND_DATA 1024
Loading