Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

191 lines
5.8 KiB

  1. /*++
  2. Copyright (C) Microsoft Corporation, 1997 - 1999
  3. Module Name:
  4. ScLogon2
  5. Abstract:
  6. This header defines APIs for use by GINA and LSA during logon via a
  7. smart card, these API's merely redirect the calls from the LSA procoess
  8. back to the corresponing Winlogon process to make the needed CSP calls
  9. Author:
  10. reidk
  11. Environment:
  12. Win32
  13. Revision History:
  14. Notes:
  15. --*/
  16. #ifndef __SCLOGON2_H__
  17. #define __SCLOGON2_H__
  18. #define SCLOGONRPC_DEFAULT_ENDPOINT TEXT("\\pipe\\sclogonpipe")
  19. #define SCLOGONRPC_DEFAULT_PROT_SEQ TEXT("ncacn_np")
  20. #define SCLOGONRPC_LOCAL_ENDPOINT TEXT("sclogonrpc")
  21. #define SCLOGONRPC_LOCAL_PROT_SEQ TEXT("ncalrpc")
  22. #define SZ_ENDPOINT_NAME_FORMAT TEXT("%s-%lx")
  23. #ifdef __cplusplus
  24. extern "C" {
  25. #endif
  26. NTSTATUS WINAPI
  27. __ScHelperInitializeContext(
  28. IN OUT PBYTE pbLogonInfo,
  29. IN ULONG cbLogonInfo
  30. );
  31. VOID WINAPI
  32. __ScHelperRelease(
  33. IN PBYTE ppbLogonInfo
  34. );
  35. NTSTATUS WINAPI
  36. __ScHelperGetProvParam(
  37. IN PUNICODE_STRING pucPIN,
  38. IN PBYTE pbLogonInfo,
  39. IN ULONG_PTR KerbHProv,
  40. DWORD dwParam,
  41. BYTE *pbData,
  42. DWORD *pdwDataLen,
  43. DWORD dwFlags
  44. );
  45. NTSTATUS WINAPI
  46. __ScHelperGetCertFromLogonInfo(
  47. IN PBYTE pbLogonInfo,
  48. IN PUNICODE_STRING pucPIN,
  49. OUT PCCERT_CONTEXT *CertificateContext
  50. );
  51. NTSTATUS WINAPI
  52. __ScHelperGenRandBits(
  53. IN PBYTE pbLogonInfo,
  54. IN ScHelper_RandomCredBits *psc_rcb
  55. );
  56. NTSTATUS WINAPI
  57. __ScHelperVerifyCardAndCreds(
  58. IN PUNICODE_STRING pucPIN,
  59. IN PCCERT_CONTEXT CertificateContext,
  60. IN PBYTE pbLogonInfo,
  61. IN PBYTE SignedEncryptedData,
  62. IN ULONG SignedEncryptedDataSize,
  63. OUT OPTIONAL PBYTE CleartextData,
  64. OUT PULONG CleartextDataSize
  65. );
  66. NTSTATUS WINAPI
  67. __ScHelperEncryptCredentials(
  68. IN PUNICODE_STRING pucPIN,
  69. IN PCCERT_CONTEXT CertificateContext,
  70. IN ScHelper_RandomCredBits *psch_rcb,
  71. IN PBYTE pbLogonInfo,
  72. IN PBYTE CleartextData,
  73. IN ULONG CleartextDataSize,
  74. OUT OPTIONAL PBYTE EncryptedData,
  75. OUT PULONG EncryptedDataSize
  76. );
  77. NTSTATUS WINAPI
  78. __ScHelperSignMessage(
  79. IN PUNICODE_STRING pucPIN,
  80. IN PBYTE pbLogonInfo,
  81. IN OPTIONAL ULONG_PTR KerbHProv,
  82. IN ULONG Algorithm,
  83. IN PBYTE Buffer,
  84. IN ULONG BufferLength,
  85. OUT PBYTE Signature,
  86. OUT PULONG SignatureLength
  87. );
  88. NTSTATUS WINAPI
  89. __ScHelperSignPkcsMessage(
  90. IN OPTIONAL PUNICODE_STRING pucPIN,
  91. IN OPTIONAL PBYTE pbLogonInfo,
  92. IN OPTIONAL ULONG_PTR KerbHProv,
  93. IN PCCERT_CONTEXT Certificate,
  94. IN PCRYPT_ALGORITHM_IDENTIFIER Algorithm,
  95. IN OPTIONAL DWORD dwSignMessageFlags,
  96. IN PBYTE Buffer,
  97. IN ULONG BufferLength,
  98. OUT OPTIONAL PBYTE SignedBuffer,
  99. OUT OPTIONAL PULONG SignedBufferLength
  100. );
  101. NTSTATUS WINAPI
  102. __ScHelperVerifyMessage(
  103. IN OPTIONAL PBYTE pbLogonInfo,
  104. IN PCCERT_CONTEXT CertificateContext,
  105. IN ULONG Algorithm,
  106. IN PBYTE Buffer,
  107. IN ULONG BufferLength,
  108. IN PBYTE Signature,
  109. IN ULONG SignatureLength
  110. );
  111. /*NTSTATUS WINAPI
  112. __ScHelperVerifyPkcsMessage(
  113. IN OPTIONAL PBYTE pbLogonInfo,
  114. IN OPTIONAL HCRYPTPROV Provider,
  115. IN PBYTE Buffer,
  116. IN ULONG BufferLength,
  117. OUT OPTIONAL PBYTE DecodedBuffer,
  118. OUT OPTIONAL PULONG DecodedBufferLength,
  119. OUT OPTIONAL PCCERT_CONTEXT *CertificateContext
  120. );*/
  121. NTSTATUS WINAPI
  122. __ScHelperDecryptMessage(
  123. IN PUNICODE_STRING pucPIN,
  124. IN OPTIONAL PBYTE pbLogonInfo,
  125. IN OPTIONAL ULONG_PTR KerbHProv,
  126. IN PCCERT_CONTEXT CertificateContext,
  127. IN PBYTE CipherText, // Supplies formatted CipherText
  128. IN ULONG CipherLength, // Supplies the length of the CiperText
  129. OUT PBYTE ClearText, // Receives decrypted message
  130. IN OUT PULONG pClearLength // Supplies length of buffer, receives actual length
  131. );
  132. NTSTATUS WINAPI
  133. __ScHelper_CryptAcquireCertificatePrivateKey(
  134. IN PCCERT_CONTEXT CertificateContext,
  135. OUT ULONG_PTR *pKerbHProv,
  136. OUT DWORD *pLastError
  137. );
  138. NTSTATUS WINAPI
  139. __ScHelper_CryptSetProvParam(
  140. IN ULONG_PTR KerbHProv,
  141. IN LPSTR pszPIN,
  142. OUT DWORD *pLastError
  143. );
  144. NTSTATUS WINAPI
  145. __ScHelper_CryptReleaseContext(
  146. IN ULONG_PTR KerbHProv
  147. );
  148. /////////////////////////////////////////////////////////////////////////////
  149. #ifdef __cplusplus
  150. }
  151. #endif
  152. #endif // __SCLOGON2_H__