summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/evp/bio_md.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/evp/bio_md.c')
-rw-r--r--src/lib/libcrypto/evp/bio_md.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/lib/libcrypto/evp/bio_md.c b/src/lib/libcrypto/evp/bio_md.c
index 317167f9c4..aef928dd8f 100644
--- a/src/lib/libcrypto/evp/bio_md.c
+++ b/src/lib/libcrypto/evp/bio_md.c
@@ -72,6 +72,8 @@ static int md_gets(BIO *h,char *str,int size);
72static long md_ctrl(BIO *h,int cmd,long arg1,char *arg2); 72static long md_ctrl(BIO *h,int cmd,long arg1,char *arg2);
73static int md_new(BIO *h); 73static int md_new(BIO *h);
74static int md_free(BIO *data); 74static int md_free(BIO *data);
75static long md_callback_ctrl(BIO *h,int cmd,void (*fp)());
76
75static BIO_METHOD methods_md= 77static BIO_METHOD methods_md=
76 { 78 {
77 BIO_TYPE_MD,"message digest", 79 BIO_TYPE_MD,"message digest",
@@ -82,6 +84,7 @@ static BIO_METHOD methods_md=
82 md_ctrl, 84 md_ctrl,
83 md_new, 85 md_new,
84 md_free, 86 md_free,
87 md_callback_ctrl,
85 }; 88 };
86 89
87BIO_METHOD *BIO_f_md(void) 90BIO_METHOD *BIO_f_md(void)
@@ -220,6 +223,20 @@ static long md_ctrl(BIO *b, int cmd, long num, char *ptr)
220 return(ret); 223 return(ret);
221 } 224 }
222 225
226static long md_callback_ctrl(BIO *b, int cmd, void (*fp)())
227 {
228 long ret=1;
229
230 if (b->next_bio == NULL) return(0);
231 switch (cmd)
232 {
233 default:
234 ret=BIO_callback_ctrl(b->next_bio,cmd,fp);
235 break;
236 }
237 return(ret);
238 }
239
223static int md_gets(BIO *bp, char *buf, int size) 240static int md_gets(BIO *bp, char *buf, int size)
224 { 241 {
225 EVP_MD_CTX *ctx; 242 EVP_MD_CTX *ctx;