diff options
Diffstat (limited to 'src/lib/libcrypto/cms/cms_dd.c')
-rw-r--r-- | src/lib/libcrypto/cms/cms_dd.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/lib/libcrypto/cms/cms_dd.c b/src/lib/libcrypto/cms/cms_dd.c index fcc446fa2e..b9422fab42 100644 --- a/src/lib/libcrypto/cms/cms_dd.c +++ b/src/lib/libcrypto/cms/cms_dd.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: cms_dd.c,v 1.10 2019/08/10 16:42:20 jsing Exp $ */ | 1 | /* $OpenBSD: cms_dd.c,v 1.11 2019/08/10 18:15:52 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 3 | * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
4 | * project. | 4 | * project. |
@@ -62,10 +62,12 @@ | |||
62 | 62 | ||
63 | /* CMS DigestedData Utilities */ | 63 | /* CMS DigestedData Utilities */ |
64 | 64 | ||
65 | CMS_ContentInfo *cms_DigestedData_create(const EVP_MD *md) | 65 | CMS_ContentInfo * |
66 | cms_DigestedData_create(const EVP_MD *md) | ||
66 | { | 67 | { |
67 | CMS_ContentInfo *cms; | 68 | CMS_ContentInfo *cms; |
68 | CMS_DigestedData *dd; | 69 | CMS_DigestedData *dd; |
70 | |||
69 | cms = CMS_ContentInfo_new(); | 71 | cms = CMS_ContentInfo_new(); |
70 | if (cms == NULL) | 72 | if (cms == NULL) |
71 | return NULL; | 73 | return NULL; |
@@ -87,17 +89,22 @@ CMS_ContentInfo *cms_DigestedData_create(const EVP_MD *md) | |||
87 | 89 | ||
88 | err: | 90 | err: |
89 | CMS_ContentInfo_free(cms); | 91 | CMS_ContentInfo_free(cms); |
92 | |||
90 | return NULL; | 93 | return NULL; |
91 | } | 94 | } |
92 | 95 | ||
93 | BIO *cms_DigestedData_init_bio(CMS_ContentInfo *cms) | 96 | BIO * |
97 | cms_DigestedData_init_bio(CMS_ContentInfo *cms) | ||
94 | { | 98 | { |
95 | CMS_DigestedData *dd; | 99 | CMS_DigestedData *dd; |
100 | |||
96 | dd = cms->d.digestedData; | 101 | dd = cms->d.digestedData; |
102 | |||
97 | return cms_DigestAlgorithm_init_bio(dd->digestAlgorithm); | 103 | return cms_DigestAlgorithm_init_bio(dd->digestAlgorithm); |
98 | } | 104 | } |
99 | 105 | ||
100 | int cms_DigestedData_do_final(CMS_ContentInfo *cms, BIO *chain, int verify) | 106 | int |
107 | cms_DigestedData_do_final(CMS_ContentInfo *cms, BIO *chain, int verify) | ||
101 | { | 108 | { |
102 | EVP_MD_CTX *mctx = EVP_MD_CTX_new(); | 109 | EVP_MD_CTX *mctx = EVP_MD_CTX_new(); |
103 | unsigned char md[EVP_MAX_MD_SIZE]; | 110 | unsigned char md[EVP_MAX_MD_SIZE]; |
@@ -140,5 +147,4 @@ int cms_DigestedData_do_final(CMS_ContentInfo *cms, BIO *chain, int verify) | |||
140 | EVP_MD_CTX_free(mctx); | 147 | EVP_MD_CTX_free(mctx); |
141 | 148 | ||
142 | return r; | 149 | return r; |
143 | |||
144 | } | 150 | } |