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/libcrypto/ocsp | |
| 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/libcrypto/ocsp')
| -rw-r--r-- | src/lib/libcrypto/ocsp/ocsp_ext.c | 12 | ||||
| -rw-r--r-- | src/lib/libcrypto/ocsp/ocsp_ht.c | 8 | ||||
| -rw-r--r-- | src/lib/libcrypto/ocsp/ocsp_lib.c | 10 |
3 files changed, 15 insertions, 15 deletions
diff --git a/src/lib/libcrypto/ocsp/ocsp_ext.c b/src/lib/libcrypto/ocsp/ocsp_ext.c index ec884cb08f..9c7832b301 100644 --- a/src/lib/libcrypto/ocsp/ocsp_ext.c +++ b/src/lib/libcrypto/ocsp/ocsp_ext.c | |||
| @@ -274,7 +274,7 @@ ASN1_STRING *ASN1_STRING_encode(ASN1_STRING *s, i2d_of_void *i2d, | |||
| 274 | if (data) | 274 | if (data) |
| 275 | { | 275 | { |
| 276 | if ((i=i2d(data,NULL)) <= 0) goto err; | 276 | if ((i=i2d(data,NULL)) <= 0) goto err; |
| 277 | if (!(b=p=OPENSSL_malloc((unsigned int)i))) | 277 | if (!(b=p=malloc((unsigned int)i))) |
| 278 | goto err; | 278 | goto err; |
| 279 | if (i2d(data, &p) <= 0) goto err; | 279 | if (i2d(data, &p) <= 0) goto err; |
| 280 | } | 280 | } |
| @@ -285,7 +285,7 @@ ASN1_STRING *ASN1_STRING_encode(ASN1_STRING *s, i2d_of_void *i2d, | |||
| 285 | V_ASN1_SEQUENCE, | 285 | V_ASN1_SEQUENCE, |
| 286 | V_ASN1_UNIVERSAL, | 286 | V_ASN1_UNIVERSAL, |
| 287 | IS_SEQUENCE))<=0) goto err; | 287 | IS_SEQUENCE))<=0) goto err; |
| 288 | if (!(b=p=OPENSSL_malloc((unsigned int)i))) | 288 | if (!(b=p=malloc((unsigned int)i))) |
| 289 | goto err; | 289 | goto err; |
| 290 | if (i2d_ASN1_SET_OF_ASN1_OBJECT(sk,&p,(I2D_OF(ASN1_OBJECT))i2d, | 290 | if (i2d_ASN1_SET_OF_ASN1_OBJECT(sk,&p,(I2D_OF(ASN1_OBJECT))i2d, |
| 291 | V_ASN1_SEQUENCE, | 291 | V_ASN1_SEQUENCE, |
| @@ -299,10 +299,10 @@ ASN1_STRING *ASN1_STRING_encode(ASN1_STRING *s, i2d_of_void *i2d, | |||
| 299 | } | 299 | } |
| 300 | if (!s && !(s = ASN1_STRING_new())) goto err; | 300 | if (!s && !(s = ASN1_STRING_new())) goto err; |
| 301 | if (!(ASN1_STRING_set(s, b, i))) goto err; | 301 | if (!(ASN1_STRING_set(s, b, i))) goto err; |
| 302 | OPENSSL_free(b); | 302 | free(b); |
| 303 | return s; | 303 | return s; |
| 304 | err: | 304 | err: |
| 305 | if (b) OPENSSL_free(b); | 305 | if (b) free(b); |
| 306 | return NULL; | 306 | return NULL; |
| 307 | } | 307 | } |
| 308 | #endif | 308 | #endif |
| @@ -327,7 +327,7 @@ static int ocsp_add1_nonce(STACK_OF(X509_EXTENSION) **exts, unsigned char *val, | |||
| 327 | * it relies on library internals. | 327 | * it relies on library internals. |
| 328 | */ | 328 | */ |
| 329 | os.length = ASN1_object_size(0, len, V_ASN1_OCTET_STRING); | 329 | os.length = ASN1_object_size(0, len, V_ASN1_OCTET_STRING); |
| 330 | os.data = OPENSSL_malloc(os.length); | 330 | os.data = malloc(os.length); |
| 331 | if (os.data == NULL) | 331 | if (os.data == NULL) |
| 332 | goto err; | 332 | goto err; |
| 333 | tmpval = os.data; | 333 | tmpval = os.data; |
| @@ -342,7 +342,7 @@ static int ocsp_add1_nonce(STACK_OF(X509_EXTENSION) **exts, unsigned char *val, | |||
| 342 | ret = 1; | 342 | ret = 1; |
| 343 | err: | 343 | err: |
| 344 | if (os.data) | 344 | if (os.data) |
| 345 | OPENSSL_free(os.data); | 345 | free(os.data); |
| 346 | return ret; | 346 | return ret; |
| 347 | } | 347 | } |
| 348 | 348 | ||
diff --git a/src/lib/libcrypto/ocsp/ocsp_ht.c b/src/lib/libcrypto/ocsp/ocsp_ht.c index af5fc16691..17b252d6a8 100644 --- a/src/lib/libcrypto/ocsp/ocsp_ht.c +++ b/src/lib/libcrypto/ocsp/ocsp_ht.c | |||
| @@ -114,8 +114,8 @@ void OCSP_REQ_CTX_free(OCSP_REQ_CTX *rctx) | |||
| 114 | if (rctx->mem) | 114 | if (rctx->mem) |
| 115 | BIO_free(rctx->mem); | 115 | BIO_free(rctx->mem); |
| 116 | if (rctx->iobuf) | 116 | if (rctx->iobuf) |
| 117 | OPENSSL_free(rctx->iobuf); | 117 | free(rctx->iobuf); |
| 118 | OPENSSL_free(rctx); | 118 | free(rctx); |
| 119 | } | 119 | } |
| 120 | 120 | ||
| 121 | int OCSP_REQ_CTX_set1_req(OCSP_REQ_CTX *rctx, OCSP_REQUEST *req) | 121 | int OCSP_REQ_CTX_set1_req(OCSP_REQ_CTX *rctx, OCSP_REQUEST *req) |
| @@ -157,7 +157,7 @@ OCSP_REQ_CTX *OCSP_sendreq_new(BIO *io, char *path, OCSP_REQUEST *req, | |||
| 157 | static const char post_hdr[] = "POST %s HTTP/1.0\r\n"; | 157 | static const char post_hdr[] = "POST %s HTTP/1.0\r\n"; |
| 158 | 158 | ||
| 159 | OCSP_REQ_CTX *rctx; | 159 | OCSP_REQ_CTX *rctx; |
| 160 | rctx = OPENSSL_malloc(sizeof(OCSP_REQ_CTX)); | 160 | rctx = malloc(sizeof(OCSP_REQ_CTX)); |
| 161 | rctx->state = OHS_ERROR; | 161 | rctx->state = OHS_ERROR; |
| 162 | rctx->mem = BIO_new(BIO_s_mem()); | 162 | rctx->mem = BIO_new(BIO_s_mem()); |
| 163 | rctx->io = io; | 163 | rctx->io = io; |
| @@ -166,7 +166,7 @@ OCSP_REQ_CTX *OCSP_sendreq_new(BIO *io, char *path, OCSP_REQUEST *req, | |||
| 166 | rctx->iobuflen = maxline; | 166 | rctx->iobuflen = maxline; |
| 167 | else | 167 | else |
| 168 | rctx->iobuflen = OCSP_MAX_LINE_LEN; | 168 | rctx->iobuflen = OCSP_MAX_LINE_LEN; |
| 169 | rctx->iobuf = OPENSSL_malloc(rctx->iobuflen); | 169 | rctx->iobuf = malloc(rctx->iobuflen); |
| 170 | if (!rctx->iobuf) | 170 | if (!rctx->iobuf) |
| 171 | return 0; | 171 | return 0; |
| 172 | if (!path) | 172 | if (!path) |
diff --git a/src/lib/libcrypto/ocsp/ocsp_lib.c b/src/lib/libcrypto/ocsp/ocsp_lib.c index a94dc838ee..514cdabf2d 100644 --- a/src/lib/libcrypto/ocsp/ocsp_lib.c +++ b/src/lib/libcrypto/ocsp/ocsp_lib.c | |||
| @@ -242,7 +242,7 @@ int OCSP_parse_url(char *url, char **phost, char **pport, char **ppath, int *pss | |||
| 242 | 242 | ||
| 243 | if (!*phost) goto mem_err; | 243 | if (!*phost) goto mem_err; |
| 244 | 244 | ||
| 245 | OPENSSL_free(buf); | 245 | free(buf); |
| 246 | 246 | ||
| 247 | return 1; | 247 | return 1; |
| 248 | 248 | ||
| @@ -255,10 +255,10 @@ int OCSP_parse_url(char *url, char **phost, char **pport, char **ppath, int *pss | |||
| 255 | 255 | ||
| 256 | 256 | ||
| 257 | err: | 257 | err: |
| 258 | if (buf) OPENSSL_free(buf); | 258 | if (buf) free(buf); |
| 259 | if (*ppath) OPENSSL_free(*ppath); | 259 | if (*ppath) free(*ppath); |
| 260 | if (*pport) OPENSSL_free(*pport); | 260 | if (*pport) free(*pport); |
| 261 | if (*phost) OPENSSL_free(*phost); | 261 | if (*phost) free(*phost); |
| 262 | return 0; | 262 | return 0; |
| 263 | 263 | ||
| 264 | } | 264 | } |
