wincapi.h 1.1 KB

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