X-Git-Url: https://git.saurik.com/apple/security.git/blobdiff_plain/b1ab9ed8d0e0f1c3b66d7daa8fd5564444c56195..e3d3b979fd185d8303f28a937baa53a187fb8c7d:/libsecurity_apple_csp/lib/RSA_asymmetric.cpp?ds=sidebyside diff --git a/libsecurity_apple_csp/lib/RSA_asymmetric.cpp b/libsecurity_apple_csp/lib/RSA_asymmetric.cpp index 03167b96..b7866b79 100644 --- a/libsecurity_apple_csp/lib/RSA_asymmetric.cpp +++ b/libsecurity_apple_csp/lib/RSA_asymmetric.cpp @@ -149,14 +149,14 @@ void RSA_CryptContext::encryptBlock( /* FIXME do OAEP encoding here */ if(mRsaKey->d == NULL) { - irtn = RSA_public_encrypt(plainTextLen, + irtn = RSA_public_encrypt((int)plainTextLen, (unsigned char *)plainText, (unsigned char *)cipherText, mRsaKey, mPadding); } else { - irtn = RSA_private_encrypt(plainTextLen, + irtn = RSA_private_encrypt((int)plainTextLen, (unsigned char *)plainText, (unsigned char *)cipherText, mRsaKey, @@ -186,14 +186,14 @@ void RSA_CryptContext::decryptBlock( rsaCryptDebug("decryptBlock padding %d", mPadding); /* FIXME do OAEP encoding here */ if(mRsaKey->d == NULL) { - irtn = RSA_public_decrypt(inBlockSize(), + irtn = RSA_public_decrypt((int)inBlockSize(), (unsigned char *)cipherText, (unsigned char *)plainText, mRsaKey, mPadding); } else { - irtn = RSA_private_decrypt(inBlockSize(), + irtn = RSA_private_decrypt((int)inBlockSize(), (unsigned char *)cipherText, (unsigned char *)plainText, mRsaKey, @@ -216,9 +216,9 @@ size_t RSA_CryptContext::outputSize( { StLock _(gMutex()); - uint32 rawBytes = inSize + inBufSize(); - uint32 rawBlocks = (rawBytes + inBlockSize() - 1) / inBlockSize(); - rbprintf("--- RSA_CryptContext::outputSize inSize 0x%lx outSize 0x%lx mInBufSize 0x%lx", - inSize, rawBlocks * outBlockSize(), inBufSize()); + size_t rawBytes = inSize + inBufSize(); + size_t rawBlocks = (rawBytes + inBlockSize() - 1) / inBlockSize(); + rbprintf("--- RSA_CryptContext::outputSize inSize 0x%lux outSize 0x%lux mInBufSize 0x%lux", + (unsigned long)inSize, (unsigned long)(rawBlocks * outBlockSize()), (unsigned long)inBufSize()); return rawBlocks * outBlockSize(); }