Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed openssl=no build issues #38

Merged
merged 1 commit into from
Dec 27, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion contrib/win32/openssh/config.h.vs
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,7 @@
/* #undef HAVE_SET_ID */

/* Define to 1 if you have the `SHA256_Update' function. */
#define HAVE_SHA256_UPDATE 1
/* #undef HAVE_SHA256_UPDATE */

/* Define to 1 if you have the <sha2.h> header file. */
/* #undef HAVE_SHA2_H */
Expand Down
6 changes: 4 additions & 2 deletions contrib/win32/openssh/libssh.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@
<ExcludedFromBuild Condition="$(UseOpenSSL)==false">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="$(OpenSSH-Src-Path)digest-libc.c">
<ExcludedFromBuild Condition="$(UseOpenSSL)==false">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="$(UseOpenSSL)==true">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="$(OpenSSH-Src-Path)dispatch.c" />
<ClCompile Include="$(OpenSSH-Src-Path)dns.c" />
Expand Down Expand Up @@ -285,7 +285,9 @@
<ClCompile Include="$(OpenSSH-Src-Path)sandbox-pledge.c" />
<ClCompile Include="$(OpenSSH-Src-Path)utf8.c" />
<ClCompile Include="$(OpenSSH-Src-Path)contrib\win32\win32compat\ttymodes_windows.c" />
<ClCompile Include="..\..\..\digest-openssl.c" />
<ClCompile Include="$(OpenSSH-Src-Path)digest-openssl.c">
<ExcludedFromBuild Condition="$(UseOpenSSL)==false">true</ExcludedFromBuild>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="$(OpenSSH-Src-Path)crypto-wrap.h" />
Expand Down
9 changes: 0 additions & 9 deletions contrib/win32/win32compat/misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -614,15 +614,6 @@ w32_mkdir(const char *path_utf8, unsigned short mode) {
return returnStatus;
}

void
getrnd(u_char *s, size_t len) {
HCRYPTPROV hProvider;
if (CryptAcquireContextW(&hProvider, 0, 0, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT | CRYPT_SILENT) == FALSE ||
CryptGenRandom(hProvider, len, s) == FALSE ||
CryptReleaseContext(hProvider, 0) == FALSE)
DebugBreak();
}

int
w32_stat(const char *path, struct w32_stat *buf) {
return fileio_stat(sanitized_path(path), (struct _stat64*)buf);
Expand Down
13 changes: 13 additions & 0 deletions openbsd-compat/arc4random.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,18 @@ _rs_init(u_char *buf, size_t n)
}

#ifndef WITH_OPENSSL
#ifdef WINDOWS
#include <Wincrypt.h>
static void
getrnd(u_char *s, size_t len) {
HCRYPTPROV hProvider;
if (CryptAcquireContextW(&hProvider, 0, 0, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT | CRYPT_SILENT) == FALSE ||
CryptGenRandom(hProvider, len, s) == FALSE ||
CryptReleaseContext(hProvider, 0) == FALSE)
DebugBreak();
}

#else /* !WINDOWS */
#define SSH_RANDOM_DEV "/dev/urandom"
/* XXX use getrandom() if supported on Linux */
static void
Expand All @@ -101,6 +113,7 @@ getrnd(u_char *s, size_t len)
}
close(fd);
}
#endif /* !WINDOWS */
#endif

static void
Expand Down