summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/comp/comp_lib.c
diff options
context:
space:
mode:
authorcvs2svn <admin@example.com>2015-03-08 16:48:49 +0000
committercvs2svn <admin@example.com>2015-03-08 16:48:49 +0000
commitdecf84ba5550c1656a7fdb51b5b81969590c3f03 (patch)
tree44872802e872bdfd60730fa9cf01d9d5751251c1 /src/lib/libcrypto/comp/comp_lib.c
parent7a8f138352aa4eb7b65ac4b1a5fe7630fbee1427 (diff)
downloadopenbsd-libressl-v2.1.5.tar.gz
openbsd-libressl-v2.1.5.tar.bz2
openbsd-libressl-v2.1.5.zip
This commit was manufactured by cvs2git to create branch 'OPENBSD_5_7'.libressl-v2.1.5
Diffstat (limited to 'src/lib/libcrypto/comp/comp_lib.c')
-rw-r--r--src/lib/libcrypto/comp/comp_lib.c68
1 files changed, 0 insertions, 68 deletions
diff --git a/src/lib/libcrypto/comp/comp_lib.c b/src/lib/libcrypto/comp/comp_lib.c
deleted file mode 100644
index dde238ef72..0000000000
--- a/src/lib/libcrypto/comp/comp_lib.c
+++ /dev/null
@@ -1,68 +0,0 @@
1/* $OpenBSD: comp_lib.c,v 1.8 2014/11/03 16:58:28 tedu Exp $ */
2#include <stdio.h>
3#include <stdlib.h>
4#include <string.h>
5#include <openssl/objects.h>
6#include <openssl/comp.h>
7
8COMP_CTX *
9COMP_CTX_new(COMP_METHOD *meth)
10{
11 COMP_CTX *ret;
12
13 if ((ret = calloc(1, sizeof(COMP_CTX))) == NULL) {
14 return (NULL);
15 }
16 ret->meth = meth;
17 if ((ret->meth->init != NULL) && !ret->meth->init(ret)) {
18 free(ret);
19 ret = NULL;
20 }
21 return (ret);
22}
23
24void
25COMP_CTX_free(COMP_CTX *ctx)
26{
27 if (ctx == NULL)
28 return;
29
30 if (ctx->meth->finish != NULL)
31 ctx->meth->finish(ctx);
32
33 free(ctx);
34}
35
36int
37COMP_compress_block(COMP_CTX *ctx, unsigned char *out, int olen,
38 unsigned char *in, int ilen)
39{
40 int ret;
41
42 if (ctx->meth->compress == NULL) {
43 return (-1);
44 }
45 ret = ctx->meth->compress(ctx, out, olen, in, ilen);
46 if (ret > 0) {
47 ctx->compress_in += ilen;
48 ctx->compress_out += ret;
49 }
50 return (ret);
51}
52
53int
54COMP_expand_block(COMP_CTX *ctx, unsigned char *out, int olen,
55 unsigned char *in, int ilen)
56{
57 int ret;
58
59 if (ctx->meth->expand == NULL) {
60 return (-1);
61 }
62 ret = ctx->meth->expand(ctx, out, olen, in, ilen);
63 if (ret > 0) {
64 ctx->expand_in += ilen;
65 ctx->expand_out += ret;
66 }
67 return (ret);
68}