BIGNUM *bn = BN_new();
BIGNUM *rtn;
- rtn = BN_bin2bn(cdata.Data, cdata.Length, bn);
+ rtn = BN_bin2bn(cdata.Data, (int)cdata.Length, bn);
if(rtn == NULL) {
BN_free(bn);
CssmError::throwMe(CSSMERR_CSP_MEMORY_ERROR);
return CSSMERR_CSP_INVALID_KEY;
}
if(nssPubKeyInfo.algorithm.parameters.Data != NULL) {
- uint32 len = nssPubKeyInfo.algorithm.parameters.Length;
+ CSSM_SIZE len = nssPubKeyInfo.algorithm.parameters.Length;
*algParams = (uint8 *)malloc(len);
memmove(*algParams, nssPubKeyInfo.algorithm.parameters.Data, len);
*algParamLen = len;
return CSSMERR_CSP_INVALID_KEY;
}
if(nssPrivKeyInfo.algorithm.parameters.Data != NULL) {
- uint32 len = nssPrivKeyInfo.algorithm.parameters.Length;
+ CSSM_SIZE len = nssPrivKeyInfo.algorithm.parameters.Length;
*algParams = (uint8 *)malloc(len);
memmove(*algParams, nssPrivKeyInfo.algorithm.parameters.Data, len);
*algParamLen = len;
CSSM_DATA encodedParams = {0, NULL};
/* TBD encode the label into a RSAES-OAEP-params */
- return RSAPrivateKeyEncodePKCS8(coder, openKey, encodedKey, encodedParams.Data, encodedParams.Length);
+ return RSAPrivateKeyEncodePKCS8(coder, openKey, encodedKey, encodedParams.Data, (unsigned int)encodedParams.Length);
}
CSSM_RETURN RSAOAEPPublicKeyEncode(
CSSM_DATA encodedParams = {0, NULL};
/* TBD encode the label into a RSAES-OAEP-params */
- return RSAPublicKeyEncodeX509(coder, openKey, encodedKey, encodedParams.Data, encodedParams.Length);
+ return RSAPublicKeyEncodeX509(coder, openKey, encodedKey, encodedParams.Data, (unsigned int)encodedParams.Length);
}
CSSM_RETURN RSAOAEPPublicKeyDecode(
* DSA public keys, FIPS186 format.
* Compatible with BSAFE.
*/
+static
CSSM_RETURN DSAPublicKeyDecodeFIPS186(
SecNssCoder &coder,
DSA *openKey,
void *p,
- unsigned length)
+ size_t length)
{
NSS_DSAPublicKeyBSAFE nssPubKey;
PRErrorCode perr;
return 0;
}
+static
CSSM_RETURN DSAPublicKeyEncodeFIPS186(
SecNssCoder &coder,
DSA *openKey,
* DSA private keys, FIPS186 format.
* Compatible with BSAFE.
*/
+static
CSSM_RETURN DSAPrivateKeyDecodeFIPS186(
SecNssCoder &coder,
DSA *openKey,
}
}
+static
CSSM_RETURN DSAPrivateKeyEncodeFIPS186(
SecNssCoder &coder,
DSA *openKey,
/*
* DSA private keys, PKCS8/SMIME format.
*/
+static
CSSM_RETURN DSAPrivateKeyDecodePKCS8(
SecNssCoder &coder,
DSA *openKey,
}
}
+static
CSSM_RETURN DSAPrivateKeyEncodePKCS8(
SecNssCoder &coder,
DSA *openKey,
switch(format) {
case CSSM_KEYBLOB_RAW_FORMAT_FIPS186:
- return DSAPrivateKeyDecodeFIPS186(coder, openKey, p, length);
+ return DSAPrivateKeyDecodeFIPS186(coder, openKey, p, (unsigned)length);
case CSSM_KEYBLOB_RAW_FORMAT_OPENSSL:
return DSAPrivateKeyDecodeOpenssl(coder, openKey, p, length);
case CSSM_KEYBLOB_RAW_FORMAT_PKCS8:
- return DSAPrivateKeyDecodePKCS8(coder, openKey, p, length);
+ return DSAPrivateKeyDecodePKCS8(coder, openKey, p, (unsigned)length);
default:
assert(0);
return CSSMERR_CSP_INTERNAL_ERROR;
#pragma mark -
#pragma mark *** Diffie-Hellman key encode/decode ***
-
+static
CSSM_RETURN DHPrivateKeyDecodePKCS3(
SecNssCoder &coder,
DH *openKey,
return 0;
}
+static
CSSM_RETURN DHPrivateKeyEncodePKCS3(
SecNssCoder &coder,
DH *openKey,
return CSSM_OK;
}
+static
CSSM_RETURN DHPrivateKeyDecodePKCS8(
SecNssCoder &coder,
DH *openKey,
return 0;
}
+static
CSSM_RETURN DHPrivateKeyEncodePKCS8(
SecNssCoder &coder,
DH *openKey,