Updated libgit to version 2.46.2 based on Git for Windows sources
[TortoiseGit.git] / src / TortoisePlink / Windows / cryptoapi.h
blob99445fe0d258eb5d91307cbd2d04817adae5fa07
1 /*
2 * cryptoapi.h: Windows Crypto API functions defined in PuTTY that
3 * use the crypt32 library. Also centralises the machinery for
4 * dynamically loading that library, and our own functions using that
5 * in turn.
6 */
8 DECL_WINDOWS_FUNCTION(extern, BOOL, CryptProtectMemory, (LPVOID,DWORD,DWORD));
10 bool got_crypt(void);
13 * Function to obfuscate an input string into something usable as a
14 * pathname for a Windows named pipe. Uses CryptProtectMemory to make
15 * the obfuscation depend on a key Windows stores for the owning user,
16 * and then hashes the string as well to make it have a manageable
17 * length and be composed of filename-legal characters.
19 * Rationale: Windows's named pipes all live in the same namespace, so
20 * one user can see what pipes another user has open. This is an
21 * undesirable privacy leak: in particular, if we used unobfuscated
22 * names for the connection-sharing pipe names, it would permit one
23 * user to know what username@host another user is SSHing to.
25 * The returned string is dynamically allocated.
27 char *capi_obfuscate_string(const char *realname);