static void free_CSWIFT_LIBNAME(void)
{
- if (CSWIFT_LIBNAME)
- OPENSSL_free((void *)CSWIFT_LIBNAME);
+ OPENSSL_free(CSWIFT_LIBNAME);
CSWIFT_LIBNAME = NULL;
}
/* Everything's fine. */
return 1;
err:
- if (cswift_dso) {
- DSO_free(cswift_dso);
- cswift_dso = NULL;
- }
+ DSO_free(cswift_dso);
+ cswift_dso = NULL;
p_CSwift_AcquireAccContext = NULL;
p_CSwift_AttachKeyParam = NULL;
p_CSwift_SimpleRequest = NULL;
while (((out->nbytes = (numbytes + mod)) % 32)) {
mod++;
}
- out->value = (unsigned char *)OPENSSL_malloc(out->nbytes);
+ out->value = OPENSSL_malloc(out->nbytes);
if (!out->value) {
return 0;
}
BN_bin2bn((unsigned char *)result->d, res.nbytes, r);
to_return = 1;
err:
- if (sw_param.up.crt.p.value)
- OPENSSL_free(sw_param.up.crt.p.value);
- if (sw_param.up.crt.q.value)
- OPENSSL_free(sw_param.up.crt.q.value);
- if (sw_param.up.crt.dmp1.value)
- OPENSSL_free(sw_param.up.crt.dmp1.value);
- if (sw_param.up.crt.dmq1.value)
- OPENSSL_free(sw_param.up.crt.dmq1.value);
- if (sw_param.up.crt.iqmp.value)
- OPENSSL_free(sw_param.up.crt.iqmp.value);
- if (result)
- BN_free(result);
- if (argument)
- BN_free(argument);
+ OPENSSL_free(sw_param.up.crt.p.value);
+ OPENSSL_free(sw_param.up.crt.q.value);
+ OPENSSL_free(sw_param.up.crt.dmp1.value);
+ OPENSSL_free(sw_param.up.crt.dmq1.value);
+ OPENSSL_free(sw_param.up.crt.iqmp.value);
+ BN_free(result);
+ BN_free(argument);
if (acquired)
release_context(hac);
return to_return;
# ifdef RSA_NULL
def_rsa_method = RSA_null_method();
# else
-# if 0
- def_rsa_method = RSA_PKCS1_RSAref();
-# else
def_rsa_method = RSA_PKCS1_SSLeay();
-# endif
# endif
if (def_rsa_method)
return def_rsa_method->rsa_mod_exp(r0, I, rsa, ctx);
# ifdef RSA_NULL
def_rsa_method = RSA_null_method();
# else
-# if 0
- def_rsa_method = RSA_PKCS1_RSAref();
-# else
def_rsa_method = RSA_PKCS1_SSLeay();
-# endif
# endif
if (def_rsa_method)
return def_rsa_method->bn_mod_exp(r, a, p, m, ctx, m_ctx);
err:
if (acquired)
release_context(hac);
- if (ctx) {
+ if (ctx)
BN_CTX_end(ctx);
- BN_CTX_free(ctx);
- }
+ BN_CTX_free(ctx);
return to_return;
}
err:
if (acquired)
release_context(hac);
- if (ctx) {
+ if (ctx)
BN_CTX_end(ctx);
- BN_CTX_free(ctx);
- }
+ BN_CTX_free(ctx);
return to_return;
}
# endif
while (num >= (int)sizeof(buf32)) {
largenum.value = buf;
largenum.nbytes = sizeof(buf32);
- /*-
- * tell CryptoSwift how many bytes we want and where we want it.
- * Note: - CryptoSwift cannot do more than 4096 bytes at a time.
- * - CryptoSwift can only do multiple of 32-bits.
- */
+ /*-
+ * tell CryptoSwift how many bytes we want and where we want it.
+ * Note: - CryptoSwift cannot do more than 4096 bytes at a time.
+ * - CryptoSwift can only do multiple of 32-bits.
+ */
swrc =
p_CSwift_SimpleRequest(hac, SW_CMD_RAND, NULL, 0, &largenum, 1);
if (swrc != SW_OK) {