Source code of Windows XP (NT5)
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.

170 lines
5.0 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. DWORD dwParam,
  40. BYTE *pbData,
  41. DWORD *pdwDataLen,
  42. DWORD dwFlags
  43. );
  44. NTSTATUS WINAPI
  45. __ScHelperGetCertFromLogonInfo(
  46. IN PBYTE pbLogonInfo,
  47. IN PUNICODE_STRING pucPIN,
  48. OUT PCCERT_CONTEXT *CertificateContext
  49. );
  50. NTSTATUS WINAPI
  51. __ScHelperGenRandBits(
  52. IN PBYTE pbLogonInfo,
  53. IN ScHelper_RandomCredBits *psc_rcb
  54. );
  55. NTSTATUS WINAPI
  56. __ScHelperVerifyCardAndCreds(
  57. IN PUNICODE_STRING pucPIN,
  58. IN PCCERT_CONTEXT CertificateContext,
  59. IN PBYTE pbLogonInfo,
  60. IN PBYTE SignedEncryptedData,
  61. IN ULONG SignedEncryptedDataSize,
  62. OUT OPTIONAL PBYTE CleartextData,
  63. OUT PULONG CleartextDataSize
  64. );
  65. NTSTATUS WINAPI
  66. __ScHelperEncryptCredentials(
  67. IN PUNICODE_STRING pucPIN,
  68. IN PCCERT_CONTEXT CertificateContext,
  69. IN ScHelper_RandomCredBits *psch_rcb,
  70. IN PBYTE pbLogonInfo,
  71. IN PBYTE CleartextData,
  72. IN ULONG CleartextDataSize,
  73. OUT OPTIONAL PBYTE EncryptedData,
  74. OUT PULONG EncryptedDataSize
  75. );
  76. NTSTATUS WINAPI
  77. __ScHelperSignMessage(
  78. IN PUNICODE_STRING pucPIN,
  79. IN PBYTE pbLogonInfo,
  80. IN OPTIONAL HCRYPTPROV Provider,
  81. IN ULONG Algorithm,
  82. IN PBYTE Buffer,
  83. IN ULONG BufferLength,
  84. OUT PBYTE Signature,
  85. OUT PULONG SignatureLength
  86. );
  87. NTSTATUS WINAPI
  88. __ScHelperSignPkcsMessage(
  89. IN OPTIONAL PUNICODE_STRING pucPIN,
  90. IN OPTIONAL PBYTE pbLogonInfo,
  91. IN OPTIONAL HCRYPTPROV Provider,
  92. IN PCCERT_CONTEXT Certificate,
  93. IN PCRYPT_ALGORITHM_IDENTIFIER Algorithm,
  94. IN OPTIONAL DWORD dwSignMessageFlags,
  95. IN PBYTE Buffer,
  96. IN ULONG BufferLength,
  97. OUT OPTIONAL PBYTE SignedBuffer,
  98. OUT OPTIONAL PULONG SignedBufferLength
  99. );
  100. NTSTATUS WINAPI
  101. __ScHelperVerifyMessage(
  102. IN OPTIONAL PBYTE pbLogonInfo,
  103. IN PCCERT_CONTEXT CertificateContext,
  104. IN ULONG Algorithm,
  105. IN PBYTE Buffer,
  106. IN ULONG BufferLength,
  107. IN PBYTE Signature,
  108. IN ULONG SignatureLength
  109. );
  110. NTSTATUS WINAPI
  111. __ScHelperVerifyPkcsMessage(
  112. IN OPTIONAL PBYTE pbLogonInfo,
  113. IN OPTIONAL HCRYPTPROV Provider,
  114. IN PBYTE Buffer,
  115. IN ULONG BufferLength,
  116. OUT OPTIONAL PBYTE DecodedBuffer,
  117. OUT OPTIONAL PULONG DecodedBufferLength,
  118. OUT OPTIONAL PCCERT_CONTEXT *CertificateContext
  119. );
  120. NTSTATUS WINAPI
  121. __ScHelperDecryptMessage(
  122. IN PUNICODE_STRING pucPIN,
  123. IN OPTIONAL PBYTE pbLogonInfo,
  124. IN OPTIONAL HCRYPTPROV Provider,
  125. IN PCCERT_CONTEXT CertificateContext,
  126. IN PBYTE CipherText, // Supplies formatted CipherText
  127. IN ULONG CipherLength, // Supplies the length of the CiperText
  128. OUT PBYTE ClearText, // Receives decrypted message
  129. IN OUT PULONG pClearLength // Supplies length of buffer, receives actual length
  130. );
  131. /////////////////////////////////////////////////////////////////////////////
  132. #ifdef __cplusplus
  133. }
  134. #endif
  135. #endif // __SCLOGON2_H__