summaryrefslogtreecommitdiffstats
path: root/lib/libcrypto/ts
diff options
context:
space:
mode:
authorbeck <beck@openbsd.org>2014-04-17 13:37:48 +0000
committerbeck <beck@openbsd.org>2014-04-17 13:37:48 +0000
commit6f3a6cb14ff86acbae89a0395ba3cdc01e85fa54 (patch)
treee7ca531f41f3403bf7f04411c40317e859a02460 /lib/libcrypto/ts
parentRevert unintended whitespace changes. (diff)
downloadwireguard-openbsd-6f3a6cb14ff86acbae89a0395ba3cdc01e85fa54.tar.xz
wireguard-openbsd-6f3a6cb14ff86acbae89a0395ba3cdc01e85fa54.zip
Change library to use intrinsic memory allocation functions instead of
OPENSSL_foo wrappers. This changes: OPENSSL_malloc->malloc OPENSSL_free->free OPENSSL_relloc->realloc OPENSSL_freeFunc->free
Diffstat (limited to 'lib/libcrypto/ts')
-rw-r--r--lib/libcrypto/ts/ts_lib.c2
-rw-r--r--lib/libcrypto/ts/ts_rsp_sign.c10
-rw-r--r--lib/libcrypto/ts/ts_rsp_verify.c10
-rw-r--r--lib/libcrypto/ts/ts_verify_ctx.c8
4 files changed, 15 insertions, 15 deletions
diff --git a/lib/libcrypto/ts/ts_lib.c b/lib/libcrypto/ts/ts_lib.c
index e8608dbf711..a8de801e28f 100644
--- a/lib/libcrypto/ts/ts_lib.c
+++ b/lib/libcrypto/ts/ts_lib.c
@@ -79,7 +79,7 @@ int TS_ASN1_INTEGER_print_bio(BIO *bio, const ASN1_INTEGER *num)
{
result = BIO_write(bio, "0x", 2) > 0;
result = result && BIO_write(bio, hex, strlen(hex)) > 0;
- OPENSSL_free(hex);
+ free(hex);
}
BN_free(&num_bn);
diff --git a/lib/libcrypto/ts/ts_rsp_sign.c b/lib/libcrypto/ts/ts_rsp_sign.c
index e7186a8ce01..e52c9ff03bc 100644
--- a/lib/libcrypto/ts/ts_rsp_sign.c
+++ b/lib/libcrypto/ts/ts_rsp_sign.c
@@ -167,7 +167,7 @@ TS_RESP_CTX *TS_RESP_CTX_new()
{
TS_RESP_CTX *ctx;
- if (!(ctx = (TS_RESP_CTX *) OPENSSL_malloc(sizeof(TS_RESP_CTX))))
+ if (!(ctx = (TS_RESP_CTX *) malloc(sizeof(TS_RESP_CTX))))
{
TSerr(TS_F_TS_RESP_CTX_NEW, ERR_R_MALLOC_FAILURE);
return NULL;
@@ -195,7 +195,7 @@ void TS_RESP_CTX_free(TS_RESP_CTX *ctx)
ASN1_INTEGER_free(ctx->seconds);
ASN1_INTEGER_free(ctx->millis);
ASN1_INTEGER_free(ctx->micros);
- OPENSSL_free(ctx);
+ free(ctx);
}
int TS_RESP_CTX_set_signer_cert(TS_RESP_CTX *ctx, X509 *signer)
@@ -922,7 +922,7 @@ static int ESS_add_signing_cert(PKCS7_SIGNER_INFO *si, ESS_SIGNING_CERT *sc)
int len;
len = i2d_ESS_SIGNING_CERT(sc, NULL);
- if (!(pp = (unsigned char *) OPENSSL_malloc(len)))
+ if (!(pp = (unsigned char *) malloc(len)))
{
TSerr(TS_F_ESS_ADD_SIGNING_CERT, ERR_R_MALLOC_FAILURE);
goto err;
@@ -934,13 +934,13 @@ static int ESS_add_signing_cert(PKCS7_SIGNER_INFO *si, ESS_SIGNING_CERT *sc)
TSerr(TS_F_ESS_ADD_SIGNING_CERT, ERR_R_MALLOC_FAILURE);
goto err;
}
- OPENSSL_free(pp); pp = NULL;
+ free(pp); pp = NULL;
return PKCS7_add_signed_attribute(si,
NID_id_smime_aa_signingCertificate,
V_ASN1_SEQUENCE, seq);
err:
ASN1_STRING_free(seq);
- OPENSSL_free(pp);
+ free(pp);
return 0;
}
diff --git a/lib/libcrypto/ts/ts_rsp_verify.c b/lib/libcrypto/ts/ts_rsp_verify.c
index f241230ef4a..d51500b5d44 100644
--- a/lib/libcrypto/ts/ts_rsp_verify.c
+++ b/lib/libcrypto/ts/ts_rsp_verify.c
@@ -472,7 +472,7 @@ static int int_TS_RESP_verify_token(TS_VERIFY_CTX *ctx,
err:
X509_free(signer);
X509_ALGOR_free(md_alg);
- OPENSSL_free(imprint);
+ free(imprint);
return ret;
}
@@ -528,7 +528,7 @@ static int TS_check_status_info(TS_RESP *response)
", status text: ", embedded_status_text ?
embedded_status_text : "unspecified",
", failure codes: ", failure_text);
- OPENSSL_free(embedded_status_text);
+ free(embedded_status_text);
return 0;
}
@@ -547,7 +547,7 @@ static char *TS_get_status_text(STACK_OF(ASN1_UTF8STRING) *text)
length += 1; /* separator character */
}
/* Allocate memory (closing '\0' included). */
- if (!(result = OPENSSL_malloc(length)))
+ if (!(result = malloc(length)))
{
TSerr(TS_F_TS_GET_STATUS_TEXT, ERR_R_MALLOC_FAILURE);
return NULL;
@@ -606,7 +606,7 @@ static int TS_compute_imprint(BIO *data, TS_TST_INFO *tst_info,
if (length < 0)
goto err;
*imprint_len = length;
- if (!(*imprint = OPENSSL_malloc(*imprint_len)))
+ if (!(*imprint = malloc(*imprint_len)))
{
TSerr(TS_F_TS_COMPUTE_IMPRINT, ERR_R_MALLOC_FAILURE);
goto err;
@@ -625,7 +625,7 @@ static int TS_compute_imprint(BIO *data, TS_TST_INFO *tst_info,
return 1;
err:
X509_ALGOR_free(*md_alg);
- OPENSSL_free(*imprint);
+ free(*imprint);
*imprint_len = 0;
return 0;
}
diff --git a/lib/libcrypto/ts/ts_verify_ctx.c b/lib/libcrypto/ts/ts_verify_ctx.c
index 609b7735d42..629107aeec2 100644
--- a/lib/libcrypto/ts/ts_verify_ctx.c
+++ b/lib/libcrypto/ts/ts_verify_ctx.c
@@ -63,7 +63,7 @@
TS_VERIFY_CTX *TS_VERIFY_CTX_new(void)
{
TS_VERIFY_CTX *ctx =
- (TS_VERIFY_CTX *) OPENSSL_malloc(sizeof(TS_VERIFY_CTX));
+ (TS_VERIFY_CTX *) malloc(sizeof(TS_VERIFY_CTX));
if (ctx)
memset(ctx, 0, sizeof(TS_VERIFY_CTX));
else
@@ -82,7 +82,7 @@ void TS_VERIFY_CTX_free(TS_VERIFY_CTX *ctx)
if (!ctx) return;
TS_VERIFY_CTX_cleanup(ctx);
- OPENSSL_free(ctx);
+ free(ctx);
}
void TS_VERIFY_CTX_cleanup(TS_VERIFY_CTX *ctx)
@@ -95,7 +95,7 @@ void TS_VERIFY_CTX_cleanup(TS_VERIFY_CTX *ctx)
ASN1_OBJECT_free(ctx->policy);
X509_ALGOR_free(ctx->md_alg);
- OPENSSL_free(ctx->imprint);
+ free(ctx->imprint);
BIO_free_all(ctx->data);
@@ -138,7 +138,7 @@ TS_VERIFY_CTX *TS_REQ_to_TS_VERIFY_CTX(TS_REQ *req, TS_VERIFY_CTX *ctx)
if (!(ret->md_alg = X509_ALGOR_dup(md_alg))) goto err;
msg = TS_MSG_IMPRINT_get_msg(imprint);
ret->imprint_len = ASN1_STRING_length(msg);
- if (!(ret->imprint = OPENSSL_malloc(ret->imprint_len))) goto err;
+ if (!(ret->imprint = malloc(ret->imprint_len))) goto err;
memcpy(ret->imprint, ASN1_STRING_data(msg), ret->imprint_len);
/* Setting nonce. */