diff options
| author | djm <> | 2010-10-01 22:54:21 +0000 |
|---|---|---|
| committer | djm <> | 2010-10-01 22:54:21 +0000 |
| commit | 829fd51d4f8dde4a7f3bf54754f3c1d1a502f5e2 (patch) | |
| tree | e03b9f1bd051e844b971936729e9df549a209130 /src/lib/libcrypto/comp | |
| parent | e6b755d2a53d3cac7a344dfdd6bf7c951cac754c (diff) | |
| download | openbsd-829fd51d4f8dde4a7f3bf54754f3c1d1a502f5e2.tar.gz openbsd-829fd51d4f8dde4a7f3bf54754f3c1d1a502f5e2.tar.bz2 openbsd-829fd51d4f8dde4a7f3bf54754f3c1d1a502f5e2.zip | |
import OpenSSL-1.0.0a
Diffstat (limited to 'src/lib/libcrypto/comp')
| -rw-r--r-- | src/lib/libcrypto/comp/c_zlib.c | 18 | ||||
| -rw-r--r-- | src/lib/libcrypto/comp/comp_err.c | 2 |
2 files changed, 9 insertions, 11 deletions
diff --git a/src/lib/libcrypto/comp/c_zlib.c b/src/lib/libcrypto/comp/c_zlib.c index eccfd09137..8adf35f3fc 100644 --- a/src/lib/libcrypto/comp/c_zlib.c +++ b/src/lib/libcrypto/comp/c_zlib.c | |||
| @@ -136,15 +136,6 @@ struct zlib_state | |||
| 136 | 136 | ||
| 137 | static int zlib_stateful_ex_idx = -1; | 137 | static int zlib_stateful_ex_idx = -1; |
| 138 | 138 | ||
| 139 | static void zlib_stateful_free_ex_data(void *obj, void *item, | ||
| 140 | CRYPTO_EX_DATA *ad, int ind,long argl, void *argp) | ||
| 141 | { | ||
| 142 | struct zlib_state *state = (struct zlib_state *)item; | ||
| 143 | inflateEnd(&state->istream); | ||
| 144 | deflateEnd(&state->ostream); | ||
| 145 | OPENSSL_free(state); | ||
| 146 | } | ||
| 147 | |||
| 148 | static int zlib_stateful_init(COMP_CTX *ctx) | 139 | static int zlib_stateful_init(COMP_CTX *ctx) |
| 149 | { | 140 | { |
| 150 | int err; | 141 | int err; |
| @@ -188,6 +179,12 @@ static int zlib_stateful_init(COMP_CTX *ctx) | |||
| 188 | 179 | ||
| 189 | static void zlib_stateful_finish(COMP_CTX *ctx) | 180 | static void zlib_stateful_finish(COMP_CTX *ctx) |
| 190 | { | 181 | { |
| 182 | struct zlib_state *state = | ||
| 183 | (struct zlib_state *)CRYPTO_get_ex_data(&ctx->ex_data, | ||
| 184 | zlib_stateful_ex_idx); | ||
| 185 | inflateEnd(&state->istream); | ||
| 186 | deflateEnd(&state->ostream); | ||
| 187 | OPENSSL_free(state); | ||
| 191 | CRYPTO_free_ex_data(CRYPTO_EX_INDEX_COMP,ctx,&ctx->ex_data); | 188 | CRYPTO_free_ex_data(CRYPTO_EX_INDEX_COMP,ctx,&ctx->ex_data); |
| 192 | } | 189 | } |
| 193 | 190 | ||
| @@ -402,7 +399,7 @@ COMP_METHOD *COMP_zlib(void) | |||
| 402 | if (zlib_stateful_ex_idx == -1) | 399 | if (zlib_stateful_ex_idx == -1) |
| 403 | zlib_stateful_ex_idx = | 400 | zlib_stateful_ex_idx = |
| 404 | CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_COMP, | 401 | CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_COMP, |
| 405 | 0,NULL,NULL,NULL,zlib_stateful_free_ex_data); | 402 | 0,NULL,NULL,NULL,NULL); |
| 406 | CRYPTO_w_unlock(CRYPTO_LOCK_COMP); | 403 | CRYPTO_w_unlock(CRYPTO_LOCK_COMP); |
| 407 | if (zlib_stateful_ex_idx == -1) | 404 | if (zlib_stateful_ex_idx == -1) |
| 408 | goto err; | 405 | goto err; |
| @@ -784,6 +781,7 @@ static long bio_zlib_ctrl(BIO *b, int cmd, long num, void *ptr) | |||
| 784 | default: | 781 | default: |
| 785 | ret = BIO_ctrl(b->next_bio, cmd, num, ptr); | 782 | ret = BIO_ctrl(b->next_bio, cmd, num, ptr); |
| 786 | break; | 783 | break; |
| 784 | |||
| 787 | } | 785 | } |
| 788 | 786 | ||
| 789 | return ret; | 787 | return ret; |
diff --git a/src/lib/libcrypto/comp/comp_err.c b/src/lib/libcrypto/comp/comp_err.c index 187d68b725..661c94c3a4 100644 --- a/src/lib/libcrypto/comp/comp_err.c +++ b/src/lib/libcrypto/comp/comp_err.c | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* crypto/comp/comp_err.c */ | 1 | /* crypto/comp/comp_err.c */ |
| 2 | /* ==================================================================== | 2 | /* ==================================================================== |
| 3 | * Copyright (c) 1999-2008 The OpenSSL Project. All rights reserved. | 3 | * Copyright (c) 1999-2007 The OpenSSL Project. All rights reserved. |
| 4 | * | 4 | * |
| 5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
| 6 | * modification, are permitted provided that the following conditions | 6 | * modification, are permitted provided that the following conditions |
