aboutsummaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2007-02-08 19:07:43 +0000
committerDr. Stephen Henson <steve@openssl.org>2007-02-08 19:07:43 +0000
commit52cfa39716ede61d4eff048ce259d10816d4008b (patch)
treeb176bac7fd20fe5d6f6528e7a7010b3c00f4ba12 /crypto
parentb3bad17d1a5bc7f15c15d61bb7115f8a16b1a5e2 (diff)
downloadopenssl-52cfa39716ede61d4eff048ce259d10816d4008b.tar.gz
Add -hmac option to dgst from 0.9.7 stable branch.
Diffstat (limited to 'crypto')
-rw-r--r--crypto/bio/bio.h13
-rw-r--r--crypto/evp/bio_md.c6
-rw-r--r--crypto/evp/evp.h1
3 files changed, 14 insertions, 6 deletions
diff --git a/crypto/bio/bio.h b/crypto/bio/bio.h
index 9a81ee0bd9..26a17072f0 100644
--- a/crypto/bio/bio.h
+++ b/crypto/bio/bio.h
@@ -378,14 +378,15 @@ typedef int asn1_ps_func(BIO *b, unsigned char **pbuf, int *plen, void *parg);
#define BIO_C_NWRITE0 145
#define BIO_C_NWRITE 146
#define BIO_C_RESET_READ_REQUEST 147
+#define BIO_C_SET_MD_CTX 148
-#define BIO_C_SET_PREFIX 148
-#define BIO_C_GET_PREFIX 149
-#define BIO_C_SET_SUFFIX 150
-#define BIO_C_GET_SUFFIX 151
+#define BIO_C_SET_PREFIX 149
+#define BIO_C_GET_PREFIX 150
+#define BIO_C_SET_SUFFIX 151
+#define BIO_C_GET_SUFFIX 152
-#define BIO_C_SET_EX_ARG 152
-#define BIO_C_GET_EX_ARG 153
+#define BIO_C_SET_EX_ARG 153
+#define BIO_C_GET_EX_ARG 154
#define BIO_set_app_data(s,arg) BIO_set_ex_data(s,0,arg)
#define BIO_get_app_data(s) BIO_get_ex_data(s,0)
diff --git a/crypto/evp/bio_md.c b/crypto/evp/bio_md.c
index a6d35d8bda..f4c0a72981 100644
--- a/crypto/evp/bio_md.c
+++ b/crypto/evp/bio_md.c
@@ -196,6 +196,12 @@ static long md_ctrl(BIO *b, int cmd, long num, void *ptr)
*pctx=ctx;
b->init = 1;
break;
+ case BIO_C_SET_MD_CTX:
+ if (b->init)
+ b->ptr=ptr;
+ else
+ ret=0;
+ break;
case BIO_C_DO_STATE_MACHINE:
BIO_clear_retry_flags(b);
ret=BIO_ctrl(b->next_bio,cmd,num,ptr);
diff --git a/crypto/evp/evp.h b/crypto/evp/evp.h
index 03259d0561..8a7218fa09 100644
--- a/crypto/evp/evp.h
+++ b/crypto/evp/evp.h
@@ -463,6 +463,7 @@ void BIO_set_md(BIO *,const EVP_MD *md);
#endif
#define BIO_get_md(b,mdp) BIO_ctrl(b,BIO_C_GET_MD,0,(char *)mdp)
#define BIO_get_md_ctx(b,mdcp) BIO_ctrl(b,BIO_C_GET_MD_CTX,0,(char *)mdcp)
+#define BIO_set_md_ctx(b,mdcp) BIO_ctrl(b,BIO_C_SET_MD_CTX,0,(char *)mdcp)
#define BIO_get_cipher_status(b) BIO_ctrl(b,BIO_C_GET_CIPHER_STATUS,0,NULL)
#define BIO_get_cipher_ctx(b,c_pp) BIO_ctrl(b,BIO_C_GET_CIPHER_CTX,0,(char *)c_pp)