xmlsecurityengine/xmlseccrypto/src/xmlsecc_evp.cpp
branchRCL_3
changeset 8 e65204f75c47
parent 0 e35f40988205
child 16 d10d750052f0
equal deleted inserted replaced
4:d2801e68661f 8:e65204f75c47
    98     ctx = xmlSecSymbianCryptoEvpKeyDataGetCtx(data);
    98     ctx = xmlSecSymbianCryptoEvpKeyDataGetCtx(data);
    99     xmlSecAssert2(ctx, NULL);
    99     xmlSecAssert2(ctx, NULL);
   100 
   100 
   101     return(ctx->pKey);
   101     return(ctx->pKey);
   102 
   102 
   103 	return NULL;    
   103 	//return NULL;    
   104 }
   104 }
   105 
   105 
   106 static int
   106 static int
   107 xmlSecSymbianCryptoEvpKeyDataInitialize(xmlSecKeyDataPtr data) {
   107 xmlSecSymbianCryptoEvpKeyDataInitialize(xmlSecKeyDataPtr data) {
   108     xmlSecSymbianCryptoEvpKeyDataCtxPtr ctx;
   108     xmlSecSymbianCryptoEvpKeyDataCtxPtr ctx;
   325  * Returns pointer to newly created EVP_PKEY object or NULL if an error occurs.
   325  * Returns pointer to newly created EVP_PKEY object or NULL if an error occurs.
   326  */
   326  */
   327 EXPORT_C
   327 EXPORT_C
   328 EVP_PKEY* 
   328 EVP_PKEY* 
   329 xmlSecSymbianCryptoEvpKeyDup(EVP_PKEY* pKey) {
   329 xmlSecSymbianCryptoEvpKeyDup(EVP_PKEY* pKey) {
   330     int ret;
   330     
   331     EVP_PKEY* pKeyNew;
   331     EVP_PKEY* pKeyNew;
   332 
   332 
   333     xmlSecAssert2(pKey, NULL);
   333     xmlSecAssert2(pKey, NULL);
   334    
   334    
   335     pKeyNew = sc_pkey_duplicate(pKey);
   335     pKeyNew = sc_pkey_duplicate(pKey);
  1310  *
  1310  *
  1311  * Returns pointer to SymbianCrypto RSA key or NULL if an error occurs.
  1311  * Returns pointer to SymbianCrypto RSA key or NULL if an error occurs.
  1312  */
  1312  */
  1313 RSA* 
  1313 RSA* 
  1314 xmlSecSymbianCryptoKeyDataRsaGetRsa(xmlSecKeyDataPtr data) {
  1314 xmlSecSymbianCryptoKeyDataRsaGetRsa(xmlSecKeyDataPtr data) {
  1315     EVP_PKEY* pKey;
  1315    
  1316     
  1316     
  1317     xmlSecAssert2(xmlSecKeyDataCheckId(data, xmlSecSymbianCryptoKeyDataRsaId), NULL);
  1317     xmlSecAssert2(xmlSecKeyDataCheckId(data, xmlSecSymbianCryptoKeyDataRsaId), NULL);
  1318 /*    
  1318 /*    
  1319     pKey = xmlSecSymbianCryptoKeyDataRsaGetEvpTest(data);
  1319     pKey = xmlSecSymbianCryptoKeyDataRsaGetEvpTest(data);
  1320     xmlSecAssert2((pKey == NULL) || (pKey->type == EVP_PKEY_RSA), NULL);
  1320     xmlSecAssert2((pKey == NULL) || (pKey->type == EVP_PKEY_RSA), NULL);
  1526 static int 
  1526 static int 
  1527 xmlSecSymbianCryptoKeyDataRsaXmlWrite(xmlSecKeyDataId id, xmlSecKeyPtr key,
  1527 xmlSecSymbianCryptoKeyDataRsaXmlWrite(xmlSecKeyDataId id, xmlSecKeyPtr key,
  1528 			    xmlNodePtr node, xmlSecKeyInfoCtxPtr keyInfoCtx) {
  1528 			    xmlNodePtr node, xmlSecKeyInfoCtxPtr keyInfoCtx) {
  1529     xmlNodePtr cur;
  1529     xmlNodePtr cur;
  1530     RSA* rsa;
  1530     RSA* rsa;
  1531     int ret;
  1531    
  1532     
  1532     
  1533     xmlSecAssert2(id == xmlSecSymbianCryptoKeyDataRsaId, -1);
  1533     xmlSecAssert2(id == xmlSecSymbianCryptoKeyDataRsaId, -1);
  1534     xmlSecAssert2(key, -1);
  1534     xmlSecAssert2(key, -1);
  1535     xmlSecAssert2(xmlSecKeyDataCheckId(xmlSecKeyGetValue(key), 
  1535     xmlSecAssert2(xmlSecKeyDataCheckId(xmlSecKeyGetValue(key), 
  1536                                 xmlSecSymbianCryptoKeyDataRsaId), -1);
  1536                                 xmlSecSymbianCryptoKeyDataRsaId), -1);
  1623 // this routine is modified to fit the interface of evpwrapper.cpp
  1623 // this routine is modified to fit the interface of evpwrapper.cpp
  1624 static int
  1624 static int
  1625 xmlSecSymbianCryptoKeyDataRsaGenerate(xmlSecKeyDataPtr data, 
  1625 xmlSecSymbianCryptoKeyDataRsaGenerate(xmlSecKeyDataPtr data, 
  1626                             xmlSecSize sizeBits, 
  1626                             xmlSecSize sizeBits, 
  1627                             xmlSecKeyDataType type ATTRIBUTE_UNUSED) {
  1627                             xmlSecKeyDataType type ATTRIBUTE_UNUSED) {
  1628     RSA* rsa;
  1628    
  1629     int ret;
  1629     int ret;
  1630     EVP_PKEY *pKey;
  1630     EVP_PKEY *pKey;
  1631     
  1631     
  1632     xmlSecAssert2(xmlSecKeyDataCheckId(data, xmlSecSymbianCryptoKeyDataRsaId), -1);
  1632     xmlSecAssert2(xmlSecKeyDataCheckId(data, xmlSecSymbianCryptoKeyDataRsaId), -1);
  1633     xmlSecAssert2(sizeBits > 0, -1);
  1633     xmlSecAssert2(sizeBits > 0, -1);