]> git.ipfire.org Git - thirdparty/openssl.git/blame - crypto/comp/c_zlib.c
Removre comment with user's name
[thirdparty/openssl.git] / crypto / comp / c_zlib.c
CommitLineData
62867571
RS
1/*
2 * Copyright 1998-2016 The OpenSSL Project Authors. All Rights Reserved.
9a555706 3 *
62867571
RS
4 * Licensed under the OpenSSL license (the "License"). You may not use
5 * this file except in compliance with the License. You can obtain a copy
6 * in the file LICENSE in the source distribution or at
7 * https://www.openssl.org/source/license.html
9a555706
RS
8 */
9
dfeab068
RE
10#include <stdio.h>
11#include <stdlib.h>
12#include <string.h>
ec577822 13#include <openssl/objects.h>
02a247e0 14#include "internal/comp.h"
bdbc9b4d 15#include <openssl/err.h>
222e620b
MC
16#include "internal/cryptlib_int.h"
17#include "internal/bio.h"
9a555706 18#include "comp_lcl.h"
dfeab068 19
0f113f3e
MC
20COMP_METHOD *COMP_zlib(void);
21
22static COMP_METHOD zlib_method_nozlib = {
23 NID_undef,
24 "(undef)",
25 NULL,
26 NULL,
27 NULL,
28 NULL,
0f113f3e 29};
dfeab068 30
c4438dc0 31#ifndef ZLIB
0f113f3e 32# undef ZLIB_SHARED
c4438dc0 33#else
dfeab068 34
0f113f3e 35# include <zlib.h>
dfeab068 36
86a62cf1
RL
37static int zlib_stateful_init(COMP_CTX *ctx);
38static void zlib_stateful_finish(COMP_CTX *ctx);
39static int zlib_stateful_compress_block(COMP_CTX *ctx, unsigned char *out,
0f113f3e
MC
40 unsigned int olen, unsigned char *in,
41 unsigned int ilen);
86a62cf1 42static int zlib_stateful_expand_block(COMP_CTX *ctx, unsigned char *out,
0f113f3e
MC
43 unsigned int olen, unsigned char *in,
44 unsigned int ilen);
30e5e8ac 45
0d4fb843 46/* memory allocations functions for zlib initialisation */
0f113f3e 47static void *zlib_zalloc(void *opaque, unsigned int no, unsigned int size)
30e5e8ac 48{
0f113f3e 49 void *p;
30e5e8ac 50
b51bce94 51 p = OPENSSL_zalloc(no * size);
0f113f3e
MC
52 return p;
53}
30e5e8ac 54
0f113f3e 55static void zlib_zfree(void *opaque, void *address)
30e5e8ac 56{
0f113f3e 57 OPENSSL_free(address);
30e5e8ac
NL
58}
59
0f113f3e
MC
60
61static COMP_METHOD zlib_stateful_method = {
62 NID_zlib_compression,
63 LN_zlib_compression,
64 zlib_stateful_init,
65 zlib_stateful_finish,
66 zlib_stateful_compress_block,
121ee399 67 zlib_stateful_expand_block
0f113f3e
MC
68};
69
70/*
20f88b9b
RL
71 * When OpenSSL is built on Windows, we do not want to require that
72 * the ZLIB.DLL be available in order for the OpenSSL DLLs to
73 * work. Therefore, all ZLIB routines are loaded at run time
ad2695b1 74 * and we do not link to a .LIB file when ZLIB_SHARED is set.
20f88b9b 75 */
0f113f3e
MC
76# if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32)
77# include <windows.h>
78# endif /* !(OPENSSL_SYS_WINDOWS ||
79 * OPENSSL_SYS_WIN32) */
c4438dc0 80
0f113f3e 81# ifdef ZLIB_SHARED
921de151 82# include "internal/dso.h"
20f88b9b 83
20f88b9b 84/* Function pointers */
0f113f3e
MC
85typedef int (*compress_ft) (Bytef *dest, uLongf * destLen,
86 const Bytef *source, uLong sourceLen);
87typedef int (*inflateEnd_ft) (z_streamp strm);
88typedef int (*inflate_ft) (z_streamp strm, int flush);
89typedef int (*inflateInit__ft) (z_streamp strm,
90 const char *version, int stream_size);
91typedef int (*deflateEnd_ft) (z_streamp strm);
92typedef int (*deflate_ft) (z_streamp strm, int flush);
93typedef int (*deflateInit__ft) (z_streamp strm, int level,
94 const char *version, int stream_size);
95typedef const char *(*zError__ft) (int err);
96static compress_ft p_compress = NULL;
97static inflateEnd_ft p_inflateEnd = NULL;
98static inflate_ft p_inflate = NULL;
99static inflateInit__ft p_inflateInit_ = NULL;
100static deflateEnd_ft p_deflateEnd = NULL;
101static deflate_ft p_deflate = NULL;
102static deflateInit__ft p_deflateInit_ = NULL;
103static zError__ft p_zError = NULL;
20f88b9b
RL
104
105static int zlib_loaded = 0; /* only attempt to init func pts once */
c4438dc0 106static DSO *zlib_dso = NULL;
20f88b9b 107
0f113f3e
MC
108# define compress p_compress
109# define inflateEnd p_inflateEnd
110# define inflate p_inflate
111# define inflateInit_ p_inflateInit_
112# define deflateEnd p_deflateEnd
113# define deflate p_deflate
114# define deflateInit_ p_deflateInit_
115# define zError p_zError
116# endif /* ZLIB_SHARED */
117
118struct zlib_state {
119 z_stream istream;
120 z_stream ostream;
121};
86a62cf1 122
86a62cf1 123static int zlib_stateful_init(COMP_CTX *ctx)
0f113f3e
MC
124{
125 int err;
64b25758 126 struct zlib_state *state = OPENSSL_zalloc(sizeof(*state));
0f113f3e
MC
127
128 if (state == NULL)
129 goto err;
130
131 state->istream.zalloc = zlib_zalloc;
132 state->istream.zfree = zlib_zfree;
133 state->istream.opaque = Z_NULL;
134 state->istream.next_in = Z_NULL;
135 state->istream.next_out = Z_NULL;
0f113f3e
MC
136 err = inflateInit_(&state->istream, ZLIB_VERSION, sizeof(z_stream));
137 if (err != Z_OK)
138 goto err;
139
140 state->ostream.zalloc = zlib_zalloc;
141 state->ostream.zfree = zlib_zfree;
142 state->ostream.opaque = Z_NULL;
143 state->ostream.next_in = Z_NULL;
144 state->ostream.next_out = Z_NULL;
0f113f3e
MC
145 err = deflateInit_(&state->ostream, Z_DEFAULT_COMPRESSION,
146 ZLIB_VERSION, sizeof(z_stream));
147 if (err != Z_OK)
148 goto err;
149
121ee399 150 ctx->data = state;
0f113f3e 151 return 1;
86a62cf1 152 err:
b548a1f1 153 OPENSSL_free(state);
0f113f3e
MC
154 return 0;
155}
86a62cf1
RL
156
157static void zlib_stateful_finish(COMP_CTX *ctx)
0f113f3e 158{
121ee399 159 struct zlib_state *state = ctx->data;
0f113f3e
MC
160 inflateEnd(&state->istream);
161 deflateEnd(&state->ostream);
162 OPENSSL_free(state);
0f113f3e 163}
86a62cf1
RL
164
165static int zlib_stateful_compress_block(COMP_CTX *ctx, unsigned char *out,
0f113f3e
MC
166 unsigned int olen, unsigned char *in,
167 unsigned int ilen)
168{
169 int err = Z_OK;
121ee399 170 struct zlib_state *state = ctx->data;
0f113f3e
MC
171
172 if (state == NULL)
173 return -1;
174
175 state->ostream.next_in = in;
176 state->ostream.avail_in = ilen;
177 state->ostream.next_out = out;
178 state->ostream.avail_out = olen;
179 if (ilen > 0)
180 err = deflate(&state->ostream, Z_SYNC_FLUSH);
181 if (err != Z_OK)
182 return -1;
0f113f3e
MC
183 return olen - state->ostream.avail_out;
184}
86a62cf1
RL
185
186static int zlib_stateful_expand_block(COMP_CTX *ctx, unsigned char *out,
0f113f3e
MC
187 unsigned int olen, unsigned char *in,
188 unsigned int ilen)
189{
190 int err = Z_OK;
121ee399 191 struct zlib_state *state = ctx->data;
0f113f3e
MC
192
193 if (state == NULL)
194 return 0;
195
196 state->istream.next_in = in;
197 state->istream.avail_in = ilen;
198 state->istream.next_out = out;
199 state->istream.avail_out = olen;
200 if (ilen > 0)
201 err = inflate(&state->istream, Z_SYNC_FLUSH);
202 if (err != Z_OK)
203 return -1;
0f113f3e
MC
204 return olen - state->istream.avail_out;
205}
86a62cf1 206
dfeab068
RE
207#endif
208
6b691a5c 209COMP_METHOD *COMP_zlib(void)
0f113f3e
MC
210{
211 COMP_METHOD *meth = &zlib_method_nozlib;
20f88b9b 212
c4438dc0 213#ifdef ZLIB_SHARED
5a5c0b95
RL
214 /* LIBZ may be externally defined, and we should respect that value */
215# ifndef LIBZ
216# if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32)
217# define LIBZ "ZLIB1"
218# elif defined(OPENSSL_SYS_VMS)
219# define LIBZ "LIBZ"
220# else
221# define LIBZ "z"
222# endif
0f113f3e 223# endif
5a5c0b95
RL
224
225 if (!zlib_loaded) {
226 zlib_dso = DSO_load(NULL, LIBZ, NULL, 0);
0f113f3e
MC
227 if (zlib_dso != NULL) {
228 p_compress = (compress_ft) DSO_bind_func(zlib_dso, "compress");
229 p_inflateEnd
230 = (inflateEnd_ft) DSO_bind_func(zlib_dso, "inflateEnd");
231 p_inflate = (inflate_ft) DSO_bind_func(zlib_dso, "inflate");
232 p_inflateInit_
233 = (inflateInit__ft) DSO_bind_func(zlib_dso, "inflateInit_");
234 p_deflateEnd
235 = (deflateEnd_ft) DSO_bind_func(zlib_dso, "deflateEnd");
236 p_deflate = (deflate_ft) DSO_bind_func(zlib_dso, "deflate");
237 p_deflateInit_
238 = (deflateInit__ft) DSO_bind_func(zlib_dso, "deflateInit_");
239 p_zError = (zError__ft) DSO_bind_func(zlib_dso, "zError");
240
241 if (p_compress && p_inflateEnd && p_inflate
242 && p_inflateInit_ && p_deflateEnd
243 && p_deflate && p_deflateInit_ && p_zError)
244 zlib_loaded++;
0fc32b07
MC
245
246 if (!OPENSSL_init_crypto(OPENSSL_INIT_ZLIB, NULL)) {
b3599dbb 247 comp_zlib_cleanup_int();
0fc32b07
MC
248 return meth;
249 }
121ee399
RS
250 if (zlib_loaded)
251 meth = &zlib_stateful_method;
0f113f3e
MC
252 }
253 }
e984b2af 254#endif
121ee399
RS
255#if defined(ZLIB)
256 meth = &zlib_stateful_method;
20f88b9b
RL
257#endif
258
26a7d938 259 return meth;
0f113f3e 260}
20f88b9b 261
b3599dbb 262void comp_zlib_cleanup_int(void)
0f113f3e 263{
8931b30d 264#ifdef ZLIB_SHARED
8cbb1533
DB
265 if (zlib_dso != NULL)
266 DSO_free(zlib_dso);
267 zlib_dso = NULL;
8931b30d 268#endif
0f113f3e 269}
8931b30d
DSH
270
271#ifdef ZLIB
272
273/* Zlib based compression/decompression filter BIO */
274
0f113f3e
MC
275typedef struct {
276 unsigned char *ibuf; /* Input buffer */
277 int ibufsize; /* Buffer size */
278 z_stream zin; /* Input decompress context */
279 unsigned char *obuf; /* Output buffer */
280 int obufsize; /* Output buffer size */
281 unsigned char *optr; /* Position in output buffer */
282 int ocount; /* Amount of data in output buffer */
283 int odone; /* deflate EOF */
284 int comp_level; /* Compression level to use */
285 z_stream zout; /* Output compression context */
286} BIO_ZLIB_CTX;
287
288# define ZLIB_DEFAULT_BUFSIZE 1024
8931b30d
DSH
289
290static int bio_zlib_new(BIO *bi);
291static int bio_zlib_free(BIO *bi);
292static int bio_zlib_read(BIO *b, char *out, int outl);
293static int bio_zlib_write(BIO *b, const char *in, int inl);
294static long bio_zlib_ctrl(BIO *b, int cmd, long num, void *ptr);
295static long bio_zlib_callback_ctrl(BIO *b, int cmd, bio_info_cb *fp);
296
04f6b0fd 297static const BIO_METHOD bio_meth_zlib = {
0f113f3e
MC
298 BIO_TYPE_COMP,
299 "zlib",
513d76f4
MC
300 /* TODO: Convert to new style write function */
301 bwrite_conv,
0f113f3e 302 bio_zlib_write,
513d76f4
MC
303 /* TODO: Convert to new style read function */
304 bread_conv,
0f113f3e
MC
305 bio_zlib_read,
306 NULL,
307 NULL,
308 bio_zlib_ctrl,
309 bio_zlib_new,
310 bio_zlib_free,
311 bio_zlib_callback_ctrl
312};
8931b30d 313
04f6b0fd 314const BIO_METHOD *BIO_f_zlib(void)
0f113f3e
MC
315{
316 return &bio_meth_zlib;
317}
8931b30d
DSH
318
319static int bio_zlib_new(BIO *bi)
0f113f3e
MC
320{
321 BIO_ZLIB_CTX *ctx;
322# ifdef ZLIB_SHARED
323 (void)COMP_zlib();
324 if (!zlib_loaded) {
325 COMPerr(COMP_F_BIO_ZLIB_NEW, COMP_R_ZLIB_NOT_SUPPORTED);
326 return 0;
327 }
328# endif
64b25758 329 ctx = OPENSSL_zalloc(sizeof(*ctx));
90945fa3 330 if (ctx == NULL) {
0f113f3e
MC
331 COMPerr(COMP_F_BIO_ZLIB_NEW, ERR_R_MALLOC_FAILURE);
332 return 0;
333 }
0f113f3e
MC
334 ctx->ibufsize = ZLIB_DEFAULT_BUFSIZE;
335 ctx->obufsize = ZLIB_DEFAULT_BUFSIZE;
336 ctx->zin.zalloc = Z_NULL;
337 ctx->zin.zfree = Z_NULL;
0f113f3e
MC
338 ctx->zout.zalloc = Z_NULL;
339 ctx->zout.zfree = Z_NULL;
0f113f3e 340 ctx->comp_level = Z_DEFAULT_COMPRESSION;
222e620b
MC
341 BIO_set_init(bi, 1);
342 BIO_set_data(bi, ctx);
343
0f113f3e
MC
344 return 1;
345}
8931b30d
DSH
346
347static int bio_zlib_free(BIO *bi)
0f113f3e
MC
348{
349 BIO_ZLIB_CTX *ctx;
350 if (!bi)
351 return 0;
222e620b 352 ctx = BIO_get_data(bi);
0f113f3e
MC
353 if (ctx->ibuf) {
354 /* Destroy decompress context */
355 inflateEnd(&ctx->zin);
356 OPENSSL_free(ctx->ibuf);
357 }
358 if (ctx->obuf) {
359 /* Destroy compress context */
360 deflateEnd(&ctx->zout);
361 OPENSSL_free(ctx->obuf);
362 }
363 OPENSSL_free(ctx);
222e620b
MC
364 BIO_set_data(bi, NULL);
365 BIO_set_init(bi, 0);
366
0f113f3e
MC
367 return 1;
368}
8931b30d
DSH
369
370static int bio_zlib_read(BIO *b, char *out, int outl)
0f113f3e
MC
371{
372 BIO_ZLIB_CTX *ctx;
373 int ret;
374 z_stream *zin;
222e620b
MC
375 BIO *next = BIO_next(b);
376
0f113f3e
MC
377 if (!out || !outl)
378 return 0;
222e620b 379 ctx = BIO_get_data(b);
0f113f3e
MC
380 zin = &ctx->zin;
381 BIO_clear_retry_flags(b);
382 if (!ctx->ibuf) {
383 ctx->ibuf = OPENSSL_malloc(ctx->ibufsize);
90945fa3 384 if (ctx->ibuf == NULL) {
0f113f3e
MC
385 COMPerr(COMP_F_BIO_ZLIB_READ, ERR_R_MALLOC_FAILURE);
386 return 0;
387 }
388 inflateInit(zin);
389 zin->next_in = ctx->ibuf;
390 zin->avail_in = 0;
391 }
392
393 /* Copy output data directly to supplied buffer */
394 zin->next_out = (unsigned char *)out;
395 zin->avail_out = (unsigned int)outl;
396 for (;;) {
397 /* Decompress while data available */
398 while (zin->avail_in) {
399 ret = inflate(zin, 0);
400 if ((ret != Z_OK) && (ret != Z_STREAM_END)) {
401 COMPerr(COMP_F_BIO_ZLIB_READ, COMP_R_ZLIB_INFLATE_ERROR);
402 ERR_add_error_data(2, "zlib error:", zError(ret));
403 return 0;
404 }
405 /* If EOF or we've read everything then return */
406 if ((ret == Z_STREAM_END) || !zin->avail_out)
407 return outl - zin->avail_out;
408 }
409
410 /*
411 * No data in input buffer try to read some in, if an error then
412 * return the total data read.
413 */
222e620b 414 ret = BIO_read(next, ctx->ibuf, ctx->ibufsize);
0f113f3e
MC
415 if (ret <= 0) {
416 /* Total data read */
417 int tot = outl - zin->avail_out;
418 BIO_copy_next_retry(b);
419 if (ret < 0)
420 return (tot > 0) ? tot : ret;
421 return tot;
422 }
423 zin->avail_in = ret;
424 zin->next_in = ctx->ibuf;
425 }
426}
8931b30d
DSH
427
428static int bio_zlib_write(BIO *b, const char *in, int inl)
0f113f3e
MC
429{
430 BIO_ZLIB_CTX *ctx;
431 int ret;
432 z_stream *zout;
222e620b
MC
433 BIO *next = BIO_next(b);
434
0f113f3e
MC
435 if (!in || !inl)
436 return 0;
222e620b 437 ctx = BIO_get_data(b);
0f113f3e
MC
438 if (ctx->odone)
439 return 0;
440 zout = &ctx->zout;
441 BIO_clear_retry_flags(b);
442 if (!ctx->obuf) {
443 ctx->obuf = OPENSSL_malloc(ctx->obufsize);
444 /* Need error here */
90945fa3 445 if (ctx->obuf == NULL) {
0f113f3e
MC
446 COMPerr(COMP_F_BIO_ZLIB_WRITE, ERR_R_MALLOC_FAILURE);
447 return 0;
448 }
449 ctx->optr = ctx->obuf;
450 ctx->ocount = 0;
451 deflateInit(zout, ctx->comp_level);
452 zout->next_out = ctx->obuf;
453 zout->avail_out = ctx->obufsize;
454 }
455 /* Obtain input data directly from supplied buffer */
456 zout->next_in = (void *)in;
457 zout->avail_in = inl;
458 for (;;) {
459 /* If data in output buffer write it first */
460 while (ctx->ocount) {
222e620b 461 ret = BIO_write(next, ctx->optr, ctx->ocount);
0f113f3e
MC
462 if (ret <= 0) {
463 /* Total data written */
464 int tot = inl - zout->avail_in;
465 BIO_copy_next_retry(b);
466 if (ret < 0)
467 return (tot > 0) ? tot : ret;
468 return tot;
469 }
470 ctx->optr += ret;
471 ctx->ocount -= ret;
472 }
473
474 /* Have we consumed all supplied data? */
475 if (!zout->avail_in)
476 return inl;
477
478 /* Compress some more */
479
480 /* Reset buffer */
481 ctx->optr = ctx->obuf;
482 zout->next_out = ctx->obuf;
483 zout->avail_out = ctx->obufsize;
484 /* Compress some more */
485 ret = deflate(zout, 0);
486 if (ret != Z_OK) {
487 COMPerr(COMP_F_BIO_ZLIB_WRITE, COMP_R_ZLIB_DEFLATE_ERROR);
488 ERR_add_error_data(2, "zlib error:", zError(ret));
489 return 0;
490 }
491 ctx->ocount = ctx->obufsize - zout->avail_out;
492 }
493}
8931b30d
DSH
494
495static int bio_zlib_flush(BIO *b)
0f113f3e
MC
496{
497 BIO_ZLIB_CTX *ctx;
498 int ret;
499 z_stream *zout;
222e620b
MC
500 BIO *next = BIO_next(b);
501
502 ctx = BIO_get_data(b);
0f113f3e
MC
503 /* If no data written or already flush show success */
504 if (!ctx->obuf || (ctx->odone && !ctx->ocount))
505 return 1;
506 zout = &ctx->zout;
507 BIO_clear_retry_flags(b);
508 /* No more input data */
509 zout->next_in = NULL;
510 zout->avail_in = 0;
511 for (;;) {
512 /* If data in output buffer write it first */
513 while (ctx->ocount) {
222e620b 514 ret = BIO_write(next, ctx->optr, ctx->ocount);
0f113f3e
MC
515 if (ret <= 0) {
516 BIO_copy_next_retry(b);
517 return ret;
518 }
519 ctx->optr += ret;
520 ctx->ocount -= ret;
521 }
522 if (ctx->odone)
523 return 1;
524
525 /* Compress some more */
526
527 /* Reset buffer */
528 ctx->optr = ctx->obuf;
529 zout->next_out = ctx->obuf;
530 zout->avail_out = ctx->obufsize;
531 /* Compress some more */
532 ret = deflate(zout, Z_FINISH);
533 if (ret == Z_STREAM_END)
534 ctx->odone = 1;
535 else if (ret != Z_OK) {
536 COMPerr(COMP_F_BIO_ZLIB_FLUSH, COMP_R_ZLIB_DEFLATE_ERROR);
537 ERR_add_error_data(2, "zlib error:", zError(ret));
538 return 0;
539 }
540 ctx->ocount = ctx->obufsize - zout->avail_out;
541 }
542}
8931b30d
DSH
543
544static long bio_zlib_ctrl(BIO *b, int cmd, long num, void *ptr)
0f113f3e
MC
545{
546 BIO_ZLIB_CTX *ctx;
547 int ret, *ip;
548 int ibs, obs;
222e620b
MC
549 BIO *next = BIO_next(b);
550
551 if (next == NULL)
0f113f3e 552 return 0;
222e620b 553 ctx = BIO_get_data(b);
0f113f3e
MC
554 switch (cmd) {
555
556 case BIO_CTRL_RESET:
557 ctx->ocount = 0;
558 ctx->odone = 0;
559 ret = 1;
560 break;
561
562 case BIO_CTRL_FLUSH:
563 ret = bio_zlib_flush(b);
564 if (ret > 0)
222e620b 565 ret = BIO_flush(next);
0f113f3e
MC
566 break;
567
568 case BIO_C_SET_BUFF_SIZE:
569 ibs = -1;
570 obs = -1;
571 if (ptr != NULL) {
572 ip = ptr;
573 if (*ip == 0)
574 ibs = (int)num;
575 else
576 obs = (int)num;
577 } else {
578 ibs = (int)num;
579 obs = ibs;
580 }
581
582 if (ibs != -1) {
b548a1f1
RS
583 OPENSSL_free(ctx->ibuf);
584 ctx->ibuf = NULL;
0f113f3e
MC
585 ctx->ibufsize = ibs;
586 }
587
588 if (obs != -1) {
b548a1f1
RS
589 OPENSSL_free(ctx->obuf);
590 ctx->obuf = NULL;
0f113f3e
MC
591 ctx->obufsize = obs;
592 }
593 ret = 1;
594 break;
595
596 case BIO_C_DO_STATE_MACHINE:
597 BIO_clear_retry_flags(b);
222e620b 598 ret = BIO_ctrl(next, cmd, num, ptr);
0f113f3e
MC
599 BIO_copy_next_retry(b);
600 break;
601
602 default:
222e620b 603 ret = BIO_ctrl(next, cmd, num, ptr);
0f113f3e
MC
604 break;
605
606 }
8931b30d 607
0f113f3e
MC
608 return ret;
609}
8931b30d
DSH
610
611static long bio_zlib_callback_ctrl(BIO *b, int cmd, bio_info_cb *fp)
0f113f3e 612{
222e620b
MC
613 BIO *next = BIO_next(b);
614 if (next == NULL)
0f113f3e 615 return 0;
222e620b 616 return BIO_callback_ctrl(next, cmd, fp);
0f113f3e 617}
8931b30d
DSH
618
619#endif