X-Git-Url: https://git.saurik.com/apple/security.git/blobdiff_plain/ce3c8656732c924baf7e88df75eab50891bdc471..fa7225c82381bac4432a6edf16f53b5370238d85:/SecurityTool/createFVMaster.c diff --git a/SecurityTool/createFVMaster.c b/SecurityTool/createFVMaster.c index e563c2fc..3f8d6e89 100644 --- a/SecurityTool/createFVMaster.c +++ b/SecurityTool/createFVMaster.c @@ -26,7 +26,7 @@ #include "createFVMaster.h" #include "readline.h" -#include "security.h" +#include "security_tool.h" #include #include @@ -62,8 +62,8 @@ const char * const _masterKeychainPath = "./FileVaultMaster"; * The CSSM_ALGORITHMS and OID values defining the signature * algorithm in the generated certificate. */ -#define SR_CERT_SIGNATURE_ALGORITHM CSSM_ALGID_SHA1WithRSA -#define SR_CERT_SIGNATURE_ALG_OID CSSMOID_SHA1WithRSA +#define SR_CERT_SIGNATURE_ALGORITHM CSSM_ALGID_SHA256WithRSA +#define SR_CERT_SIGNATURE_ALG_OID CSSMOID_SHA256WithRSA OSStatus makeMasterPassword(const char *fvmkcName, const char *masterPasswordPassword, uint32 keySizeInBits, SecKeychainRef *keychainRef); @@ -98,7 +98,7 @@ OSStatus makeMasterPassword(const char *fvmkcName, const char *masterPasswordPas } // We return an error if the keychain already exists - OSStatus status = SecKeychainCreate(fvmkcName, strlen(masterPasswordPassword), masterPasswordPassword, false, initialAccess, keychainRef); + OSStatus status = SecKeychainCreate(fvmkcName, (UInt32) strlen(masterPasswordPassword), masterPasswordPassword, false, initialAccess, keychainRef); if (status!=noErr) { if (status==errSecDuplicateKeychain || status==CSSMERR_DL_DATASTORE_ALREADY_EXISTS) @@ -430,7 +430,7 @@ static CSSM_RETURN refKeyToRaw( * Find private key by label, modify its Label attr to be the * hash of the associated public key. */ -CSSM_RETURN setPubKeyHash( +static CSSM_RETURN setPubKeyHash( CSSM_CSP_HANDLE cspHand, CSSM_DL_DB_HANDLE dlDbHand, const CSSM_KEY *pubOrPrivKey, // to get hash; raw or ref/CSPDL @@ -618,7 +618,7 @@ OSStatus generateKeyPair( &dlDbHand, keyAlg, keyLabel, - strlen(keyLabel) + 1, + (int) strlen(keyLabel) + 1, keySizeInBits, pubKey, pubKeyUse,