Commit Graph

8 Commits

Author SHA1 Message Date
Jeffrey Altman
0f97855826 hcrypto: config/roken cleanup
All source files in lib/hcrypto should be built the same way.
Since this source directory is dependent on libroken then all source
files must be built using the roken.h declarations and included headers.

Also, there is no config.h in the local directory so angle brackets
include of quotes should be used.

Finally, because roken.h includes stdio.h, stdlib.h, stdarg.h, limits.h,
strings.h, sys/types.h, etc., do not include them separately.

Start all source files with

  #include <config.h>
  #include <roken.h>

Change-Id: I09ab47f8a5472018efe6c8b59a0e51fde8f24724
2016-04-10 17:05:07 -05:00
Jeffrey Altman
b3f29170a3 hcrypto: w32crypto crypt provider handle leak
_hc_CryptProvider() returns a global handle to a Win32 Crypt Provider.
If the global handle is NULL, then a handle is allocated.  Unfortunately,
due to a coding mistake the global handle variable, g_cryptprovider, was
never set and a new handle was allocated with each call.

Refactor the function to ensure that the global handle is the value
that is returned.  Use NULL instead of 0 for pointer assignment.

Change-Id: If1ef3aa19cbd1d51860370db24c086e86922ff0d
2014-12-24 15:49:31 -05:00
Jeffrey Altman
63b3cb9749 Windows: fallback to PROV_RNG if no PROV_RSA_FULL
Heimdal can be executed in environments in which the user
account profile is not loaded.  In such environments it is
not possible to use PROV_RSA_FULL as it stores required
data within the profile.  Instead, fallback to PROV_RNG which
does not store data within the profile and can be used to access
secure random number generator routines.

Change-Id: If600246f39645ed6bf5af0dd237f5adfddcf6c0c
2011-09-20 16:17:42 -04:00
Asanka Herath
ccc5fa16b1 Silence type safety warnings for rand-w32.c
Cast parameters to exact expected type so compiler won't complain.
2010-08-20 13:03:35 -04:00
Asanka Herath
7b8ebf0efe Fix return value of w32crypto_bytes() and use correct data types 2010-05-26 10:38:40 -04:00
Love Hornquist Astrand
08d12ee6e0 implement RAND_pseudorand for the w32 provider in terms of w32crypto_bytes 2009-12-24 07:13:15 +01:00
Asanka Herath
49d28d3f3a Thread safety for rand-w32 2009-11-26 01:39:42 -05:00
Love Hornquist Astrand
c8fc15de86 random number from windows csp 2009-11-25 07:52:39 -08:00