diff options
author | beck <> | 2014-04-17 13:37:50 +0000 |
---|---|---|
committer | beck <> | 2014-04-17 13:37:50 +0000 |
commit | bddb7c686e3d1aeb156722adc64b6c35ae720f87 (patch) | |
tree | 7595a93a27385c367802aa17ecf20f96551cf14d /src/lib/libssl/s3_lib.c | |
parent | ecec66222d758996a4ff2671ca5026d9ede5ef76 (diff) | |
download | openbsd-bddb7c686e3d1aeb156722adc64b6c35ae720f87.tar.gz openbsd-bddb7c686e3d1aeb156722adc64b6c35ae720f87.tar.bz2 openbsd-bddb7c686e3d1aeb156722adc64b6c35ae720f87.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 'src/lib/libssl/s3_lib.c')
-rw-r--r-- | src/lib/libssl/s3_lib.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/lib/libssl/s3_lib.c b/src/lib/libssl/s3_lib.c index 68a4b8ca2d..8df07a1e4c 100644 --- a/src/lib/libssl/s3_lib.c +++ b/src/lib/libssl/s3_lib.c | |||
@@ -2946,7 +2946,7 @@ ssl3_new(SSL *s) | |||
2946 | { | 2946 | { |
2947 | SSL3_STATE *s3; | 2947 | SSL3_STATE *s3; |
2948 | 2948 | ||
2949 | if ((s3 = OPENSSL_malloc(sizeof *s3)) == NULL) goto err; | 2949 | if ((s3 = malloc(sizeof *s3)) == NULL) goto err; |
2950 | memset(s3, 0, sizeof *s3); | 2950 | memset(s3, 0, sizeof *s3); |
2951 | memset(s3->rrec.seq_num, 0, sizeof(s3->rrec.seq_num)); | 2951 | memset(s3->rrec.seq_num, 0, sizeof(s3->rrec.seq_num)); |
2952 | memset(s3->wrec.seq_num, 0, sizeof(s3->wrec.seq_num)); | 2952 | memset(s3->wrec.seq_num, 0, sizeof(s3->wrec.seq_num)); |
@@ -2970,9 +2970,9 @@ ssl3_free(SSL *s) | |||
2970 | 2970 | ||
2971 | #ifdef TLSEXT_TYPE_opaque_prf_input | 2971 | #ifdef TLSEXT_TYPE_opaque_prf_input |
2972 | if (s->s3->client_opaque_prf_input != NULL) | 2972 | if (s->s3->client_opaque_prf_input != NULL) |
2973 | OPENSSL_free(s->s3->client_opaque_prf_input); | 2973 | free(s->s3->client_opaque_prf_input); |
2974 | if (s->s3->server_opaque_prf_input != NULL) | 2974 | if (s->s3->server_opaque_prf_input != NULL) |
2975 | OPENSSL_free(s->s3->server_opaque_prf_input); | 2975 | free(s->s3->server_opaque_prf_input); |
2976 | #endif | 2976 | #endif |
2977 | 2977 | ||
2978 | ssl3_cleanup_key_block(s); | 2978 | ssl3_cleanup_key_block(s); |
@@ -2981,7 +2981,7 @@ ssl3_free(SSL *s) | |||
2981 | if (s->s3->wbuf.buf != NULL) | 2981 | if (s->s3->wbuf.buf != NULL) |
2982 | ssl3_release_write_buffer(s); | 2982 | ssl3_release_write_buffer(s); |
2983 | if (s->s3->rrec.comp != NULL) | 2983 | if (s->s3->rrec.comp != NULL) |
2984 | OPENSSL_free(s->s3->rrec.comp); | 2984 | free(s->s3->rrec.comp); |
2985 | #ifndef OPENSSL_NO_DH | 2985 | #ifndef OPENSSL_NO_DH |
2986 | if (s->s3->tmp.dh != NULL) | 2986 | if (s->s3->tmp.dh != NULL) |
2987 | DH_free(s->s3->tmp.dh); | 2987 | DH_free(s->s3->tmp.dh); |
@@ -3002,7 +3002,7 @@ ssl3_free(SSL *s) | |||
3002 | SSL_SRP_CTX_free(s); | 3002 | SSL_SRP_CTX_free(s); |
3003 | #endif | 3003 | #endif |
3004 | OPENSSL_cleanse(s->s3, sizeof *s->s3); | 3004 | OPENSSL_cleanse(s->s3, sizeof *s->s3); |
3005 | OPENSSL_free(s->s3); | 3005 | free(s->s3); |
3006 | s->s3 = NULL; | 3006 | s->s3 = NULL; |
3007 | } | 3007 | } |
3008 | 3008 | ||
@@ -3015,10 +3015,10 @@ ssl3_clear(SSL *s) | |||
3015 | 3015 | ||
3016 | #ifdef TLSEXT_TYPE_opaque_prf_input | 3016 | #ifdef TLSEXT_TYPE_opaque_prf_input |
3017 | if (s->s3->client_opaque_prf_input != NULL) | 3017 | if (s->s3->client_opaque_prf_input != NULL) |
3018 | OPENSSL_free(s->s3->client_opaque_prf_input); | 3018 | free(s->s3->client_opaque_prf_input); |
3019 | s->s3->client_opaque_prf_input = NULL; | 3019 | s->s3->client_opaque_prf_input = NULL; |
3020 | if (s->s3->server_opaque_prf_input != NULL) | 3020 | if (s->s3->server_opaque_prf_input != NULL) |
3021 | OPENSSL_free(s->s3->server_opaque_prf_input); | 3021 | free(s->s3->server_opaque_prf_input); |
3022 | s->s3->server_opaque_prf_input = NULL; | 3022 | s->s3->server_opaque_prf_input = NULL; |
3023 | #endif | 3023 | #endif |
3024 | 3024 | ||
@@ -3027,7 +3027,7 @@ ssl3_clear(SSL *s) | |||
3027 | sk_X509_NAME_pop_free(s->s3->tmp.ca_names, X509_NAME_free); | 3027 | sk_X509_NAME_pop_free(s->s3->tmp.ca_names, X509_NAME_free); |
3028 | 3028 | ||
3029 | if (s->s3->rrec.comp != NULL) { | 3029 | if (s->s3->rrec.comp != NULL) { |
3030 | OPENSSL_free(s->s3->rrec.comp); | 3030 | free(s->s3->rrec.comp); |
3031 | s->s3->rrec.comp = NULL; | 3031 | s->s3->rrec.comp = NULL; |
3032 | } | 3032 | } |
3033 | #ifndef OPENSSL_NO_DH | 3033 | #ifndef OPENSSL_NO_DH |
@@ -3078,7 +3078,7 @@ ssl3_clear(SSL *s) | |||
3078 | 3078 | ||
3079 | #if !defined(OPENSSL_NO_TLSEXT) && !defined(OPENSSL_NO_NEXTPROTONEG) | 3079 | #if !defined(OPENSSL_NO_TLSEXT) && !defined(OPENSSL_NO_NEXTPROTONEG) |
3080 | if (s->next_proto_negotiated) { | 3080 | if (s->next_proto_negotiated) { |
3081 | OPENSSL_free(s->next_proto_negotiated); | 3081 | free(s->next_proto_negotiated); |
3082 | s->next_proto_negotiated = NULL; | 3082 | s->next_proto_negotiated = NULL; |
3083 | s->next_proto_negotiated_len = 0; | 3083 | s->next_proto_negotiated_len = 0; |
3084 | } | 3084 | } |
@@ -3236,7 +3236,7 @@ ssl3_ctrl(SSL *s, int cmd, long larg, void *parg) | |||
3236 | case SSL_CTRL_SET_TLSEXT_HOSTNAME: | 3236 | case SSL_CTRL_SET_TLSEXT_HOSTNAME: |
3237 | if (larg == TLSEXT_NAMETYPE_host_name) { | 3237 | if (larg == TLSEXT_NAMETYPE_host_name) { |
3238 | if (s->tlsext_hostname != NULL) | 3238 | if (s->tlsext_hostname != NULL) |
3239 | OPENSSL_free(s->tlsext_hostname); | 3239 | free(s->tlsext_hostname); |
3240 | s->tlsext_hostname = NULL; | 3240 | s->tlsext_hostname = NULL; |
3241 | 3241 | ||
3242 | ret = 1; | 3242 | ret = 1; |
@@ -3269,9 +3269,9 @@ ssl3_ctrl(SSL *s, int cmd, long larg, void *parg) | |||
3269 | break; | 3269 | break; |
3270 | } | 3270 | } |
3271 | if (s->tlsext_opaque_prf_input != NULL) | 3271 | if (s->tlsext_opaque_prf_input != NULL) |
3272 | OPENSSL_free(s->tlsext_opaque_prf_input); | 3272 | free(s->tlsext_opaque_prf_input); |
3273 | if ((size_t)larg == 0) | 3273 | if ((size_t)larg == 0) |
3274 | s->tlsext_opaque_prf_input = OPENSSL_malloc(1); /* dummy byte just to get non-NULL */ | 3274 | s->tlsext_opaque_prf_input = malloc(1); /* dummy byte just to get non-NULL */ |
3275 | else | 3275 | else |
3276 | s->tlsext_opaque_prf_input = BUF_memdup(parg, (size_t)larg); | 3276 | s->tlsext_opaque_prf_input = BUF_memdup(parg, (size_t)larg); |
3277 | if (s->tlsext_opaque_prf_input != NULL) { | 3277 | if (s->tlsext_opaque_prf_input != NULL) { |
@@ -3313,7 +3313,7 @@ ssl3_ctrl(SSL *s, int cmd, long larg, void *parg) | |||
3313 | 3313 | ||
3314 | case SSL_CTRL_SET_TLSEXT_STATUS_REQ_OCSP_RESP: | 3314 | case SSL_CTRL_SET_TLSEXT_STATUS_REQ_OCSP_RESP: |
3315 | if (s->tlsext_ocsp_resp) | 3315 | if (s->tlsext_ocsp_resp) |
3316 | OPENSSL_free(s->tlsext_ocsp_resp); | 3316 | free(s->tlsext_ocsp_resp); |
3317 | s->tlsext_ocsp_resp = parg; | 3317 | s->tlsext_ocsp_resp = parg; |
3318 | s->tlsext_ocsp_resplen = larg; | 3318 | s->tlsext_ocsp_resplen = larg; |
3319 | ret = 1; | 3319 | ret = 1; |
@@ -3537,7 +3537,7 @@ ssl3_ctx_ctrl(SSL_CTX *ctx, int cmd, long larg, void *parg) | |||
3537 | case SSL_CTRL_SET_TLS_EXT_SRP_USERNAME: | 3537 | case SSL_CTRL_SET_TLS_EXT_SRP_USERNAME: |
3538 | ctx->srp_ctx.srp_Mask|=SSL_kSRP; | 3538 | ctx->srp_ctx.srp_Mask|=SSL_kSRP; |
3539 | if (ctx->srp_ctx.login != NULL) | 3539 | if (ctx->srp_ctx.login != NULL) |
3540 | OPENSSL_free(ctx->srp_ctx.login); | 3540 | free(ctx->srp_ctx.login); |
3541 | ctx->srp_ctx.login = NULL; | 3541 | ctx->srp_ctx.login = NULL; |
3542 | if (parg == NULL) | 3542 | if (parg == NULL) |
3543 | break; | 3543 | break; |