diff options
Diffstat (limited to 'src/lib/libssl/src/crypto/evp/bio_md.c')
-rw-r--r-- | src/lib/libssl/src/crypto/evp/bio_md.c | 48 |
1 files changed, 11 insertions, 37 deletions
diff --git a/src/lib/libssl/src/crypto/evp/bio_md.c b/src/lib/libssl/src/crypto/evp/bio_md.c index fa5fdc055b..317167f9c4 100644 --- a/src/lib/libssl/src/crypto/evp/bio_md.c +++ b/src/lib/libssl/src/crypto/evp/bio_md.c | |||
@@ -59,13 +59,12 @@ | |||
59 | #include <stdio.h> | 59 | #include <stdio.h> |
60 | #include <errno.h> | 60 | #include <errno.h> |
61 | #include "cryptlib.h" | 61 | #include "cryptlib.h" |
62 | #include "buffer.h" | 62 | #include <openssl/buffer.h> |
63 | #include "evp.h" | 63 | #include <openssl/evp.h> |
64 | 64 | ||
65 | /* BIO_put and BIO_get both add to the digest, | 65 | /* BIO_put and BIO_get both add to the digest, |
66 | * BIO_gets returns the digest */ | 66 | * BIO_gets returns the digest */ |
67 | 67 | ||
68 | #ifndef NOPROTO | ||
69 | static int md_write(BIO *h,char *buf,int num); | 68 | static int md_write(BIO *h,char *buf,int num); |
70 | static int md_read(BIO *h,char *buf,int size); | 69 | static int md_read(BIO *h,char *buf,int size); |
71 | /*static int md_puts(BIO *h,char *str); */ | 70 | /*static int md_puts(BIO *h,char *str); */ |
@@ -73,16 +72,6 @@ static int md_gets(BIO *h,char *str,int size); | |||
73 | static long md_ctrl(BIO *h,int cmd,long arg1,char *arg2); | 72 | static long md_ctrl(BIO *h,int cmd,long arg1,char *arg2); |
74 | static int md_new(BIO *h); | 73 | static int md_new(BIO *h); |
75 | static int md_free(BIO *data); | 74 | static int md_free(BIO *data); |
76 | #else | ||
77 | static int md_write(); | ||
78 | static int md_read(); | ||
79 | /*static int md_puts(); */ | ||
80 | static int md_gets(); | ||
81 | static long md_ctrl(); | ||
82 | static int md_new(); | ||
83 | static int md_free(); | ||
84 | #endif | ||
85 | |||
86 | static BIO_METHOD methods_md= | 75 | static BIO_METHOD methods_md= |
87 | { | 76 | { |
88 | BIO_TYPE_MD,"message digest", | 77 | BIO_TYPE_MD,"message digest", |
@@ -95,13 +84,12 @@ static BIO_METHOD methods_md= | |||
95 | md_free, | 84 | md_free, |
96 | }; | 85 | }; |
97 | 86 | ||
98 | BIO_METHOD *BIO_f_md() | 87 | BIO_METHOD *BIO_f_md(void) |
99 | { | 88 | { |
100 | return(&methods_md); | 89 | return(&methods_md); |
101 | } | 90 | } |
102 | 91 | ||
103 | static int md_new(bi) | 92 | static int md_new(BIO *bi) |
104 | BIO *bi; | ||
105 | { | 93 | { |
106 | EVP_MD_CTX *ctx; | 94 | EVP_MD_CTX *ctx; |
107 | 95 | ||
@@ -114,8 +102,7 @@ BIO *bi; | |||
114 | return(1); | 102 | return(1); |
115 | } | 103 | } |
116 | 104 | ||
117 | static int md_free(a) | 105 | static int md_free(BIO *a) |
118 | BIO *a; | ||
119 | { | 106 | { |
120 | if (a == NULL) return(0); | 107 | if (a == NULL) return(0); |
121 | Free(a->ptr); | 108 | Free(a->ptr); |
@@ -125,10 +112,7 @@ BIO *a; | |||
125 | return(1); | 112 | return(1); |
126 | } | 113 | } |
127 | 114 | ||
128 | static int md_read(b,out,outl) | 115 | static int md_read(BIO *b, char *out, int outl) |
129 | BIO *b; | ||
130 | char *out; | ||
131 | int outl; | ||
132 | { | 116 | { |
133 | int ret=0; | 117 | int ret=0; |
134 | EVP_MD_CTX *ctx; | 118 | EVP_MD_CTX *ctx; |
@@ -152,10 +136,7 @@ int outl; | |||
152 | return(ret); | 136 | return(ret); |
153 | } | 137 | } |
154 | 138 | ||
155 | static int md_write(b,in,inl) | 139 | static int md_write(BIO *b, char *in, int inl) |
156 | BIO *b; | ||
157 | char *in; | ||
158 | int inl; | ||
159 | { | 140 | { |
160 | int ret=0; | 141 | int ret=0; |
161 | EVP_MD_CTX *ctx; | 142 | EVP_MD_CTX *ctx; |
@@ -178,14 +159,10 @@ int inl; | |||
178 | return(ret); | 159 | return(ret); |
179 | } | 160 | } |
180 | 161 | ||
181 | static long md_ctrl(b,cmd,num,ptr) | 162 | static long md_ctrl(BIO *b, int cmd, long num, char *ptr) |
182 | BIO *b; | ||
183 | int cmd; | ||
184 | long num; | ||
185 | char *ptr; | ||
186 | { | 163 | { |
187 | EVP_MD_CTX *ctx,*dctx,**pctx; | 164 | EVP_MD_CTX *ctx,*dctx,**pctx; |
188 | EVP_MD **ppmd; | 165 | const EVP_MD **ppmd; |
189 | EVP_MD *md; | 166 | EVP_MD *md; |
190 | long ret=1; | 167 | long ret=1; |
191 | BIO *dbio; | 168 | BIO *dbio; |
@@ -204,7 +181,7 @@ char *ptr; | |||
204 | case BIO_C_GET_MD: | 181 | case BIO_C_GET_MD: |
205 | if (b->init) | 182 | if (b->init) |
206 | { | 183 | { |
207 | ppmd=(EVP_MD **)ptr; | 184 | ppmd=(const EVP_MD **)ptr; |
208 | *ppmd=ctx->digest; | 185 | *ppmd=ctx->digest; |
209 | } | 186 | } |
210 | else | 187 | else |
@@ -243,10 +220,7 @@ char *ptr; | |||
243 | return(ret); | 220 | return(ret); |
244 | } | 221 | } |
245 | 222 | ||
246 | static int md_gets(bp,buf,size) | 223 | static int md_gets(BIO *bp, char *buf, int size) |
247 | BIO *bp; | ||
248 | char *buf; | ||
249 | int size; | ||
250 | { | 224 | { |
251 | EVP_MD_CTX *ctx; | 225 | EVP_MD_CTX *ctx; |
252 | unsigned int ret; | 226 | unsigned int ret; |