1
0
mirror of https://github.com/winscp/winscp.git synced 2026-10-24 02:28:55 +03:00
Files
winscp/source/putty/windows/cryptoapi.h
Martin Prikryl 936ab62732 PuTTY 0.77 2022-01-22 Pre-release
Source commit: fe07f3c4a6b19aa55f5b7d58e66cb55365edc059
2022-02-04 19:45:22 +01:00

28 lines
1.1 KiB
C

/*
* cryptoapi.h: Windows Crypto API functions defined in PuTTY that
* use the crypt32 library. Also centralises the machinery for
* dynamically loading that library, and our own functions using that
* in turn.
*/
DECL_WINDOWS_FUNCTION(extern, BOOL, CryptProtectMemory, (LPVOID,DWORD,DWORD));
bool got_crypt(void);
/*
* Function to obfuscate an input string into something usable as a
* pathname for a Windows named pipe. Uses CryptProtectMemory to make
* the obfuscation depend on a key Windows stores for the owning user,
* and then hashes the string as well to make it have a manageable
* length and be composed of filename-legal characters.
*
* Rationale: Windows's named pipes all live in the same namespace, so
* one user can see what pipes another user has open. This is an
* undesirable privacy leak: in particular, if we used unobfuscated
* names for the connection-sharing pipe names, it would permit one
* user to know what username@host another user is SSHing to.
*
* The returned string is dynamically allocated.
*/
char *capi_obfuscate_string(const char *realname);