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.

65 lines
1.3 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1995.
  5. //
  6. // File: rng.cxx
  7. //
  8. // Contents:
  9. //
  10. // Classes:
  11. //
  12. // Functions:
  13. //
  14. // History: 8-15-95 RichardW Created
  15. // 2-8-96 MikeSw Copied to NTLMSSP from SSL
  16. // 03-Aug-1996 ChandanS Stolen from net\svcdlls\ntlmssp\common\rng.c
  17. // 8-Dec-1997 SField Use crypto group RNG
  18. //
  19. //----------------------------------------------------------------------------
  20. #include <global.h>
  21. NTSTATUS
  22. SspGenerateRandomBits(
  23. VOID *pRandomData,
  24. ULONG cRandomData
  25. )
  26. {
  27. #if defined(USE_CONSTANT_CHALLENGE)
  28. ZeroMemory(pRandomData, cRandomData);
  29. #endif
  30. if( RtlGenRandom( pRandomData, cRandomData ) )
  31. {
  32. return STATUS_SUCCESS;
  33. }
  34. //
  35. // return a nebulous error message. this is better than returning
  36. // success which could compromise security with non-random key.
  37. //
  38. ASSERT( (STATUS_SUCCESS == STATUS_UNSUCCESSFUL) );
  39. return STATUS_UNSUCCESSFUL;
  40. }
  41. BOOL
  42. NtLmInitializeRNG(VOID)
  43. {
  44. return TRUE;
  45. }
  46. VOID
  47. NtLmCleanupRNG(VOID)
  48. {
  49. return;
  50. }