X-Git-Url: https://git.saurik.com/apple/security.git/blobdiff_plain/79b9da22a1f4b26279940d285c1bc28ce4e99252..7e6b461318c8a779d91381531435a68ee4e8b6ed:/OSX/libsecurity_apple_csp/lib/opensshWrap.cpp?ds=inline diff --git a/OSX/libsecurity_apple_csp/lib/opensshWrap.cpp b/OSX/libsecurity_apple_csp/lib/opensshWrap.cpp index 11895ac4..07185bc2 100644 --- a/OSX/libsecurity_apple_csp/lib/opensshWrap.cpp +++ b/OSX/libsecurity_apple_csp/lib/opensshWrap.cpp @@ -31,13 +31,13 @@ #include "AppleCSPUtils.h" #include "AppleCSPKeys.h" #include "RSA_DSA_keys.h" +#include "SecRandom.h" #include "opensshCoding.h" #include "cspdebugging.h" #include #include #include #include -#include #include static const char *authfile_id_string = "SSH PRIVATE KEY FILE FORMAT 1.1\n"; @@ -376,8 +376,7 @@ CSSM_RETURN encodeOpenSSHv1PrivKey( /* [0..3] check bytes */ UInt8 checkBytes[4]; - DevRandomGenerator rng = DevRandomGenerator(); - rng.random(checkBytes, 2); + MacOSError::check(SecRandomCopyBytes(kSecRandomDefault, 2, checkBytes)) ; checkBytes[2] = checkBytes[0]; checkBytes[3] = checkBytes[1]; CFDataAppendBytes(ptext, checkBytes, 4);