cryptoapi.h 1.1 KB

12345678910111213141516171819202122232425262728
  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. */
  7. DECL_WINDOWS_FUNCTION(extern, BOOL, CryptProtectMemory, (LPVOID,DWORD,DWORD));
  8. bool got_crypt(void);
  9. /*
  10. * Function to obfuscate an input string into something usable as a
  11. * pathname for a Windows named pipe. Uses CryptProtectMemory to make
  12. * the obfuscation depend on a key Windows stores for the owning user,
  13. * and then hashes the string as well to make it have a manageable
  14. * length and be composed of filename-legal characters.
  15. *
  16. * Rationale: Windows's named pipes all live in the same namespace, so
  17. * one user can see what pipes another user has open. This is an
  18. * undesirable privacy leak: in particular, if we used unobfuscated
  19. * names for the connection-sharing pipe names, it would permit one
  20. * user to know what username@host another user is SSHing to.
  21. *
  22. * The returned string is dynamically allocated.
  23. */
  24. char *capi_obfuscate_string(const char *realname);