OLD | NEW |
1 =pod | 1 =pod |
2 | 2 |
3 =head1 NAME | 3 =head1 NAME |
4 | 4 |
5 BIO_f_md, BIO_set_md, BIO_get_md, BIO_get_md_ctx - message digest BIO filter | 5 BIO_f_md, BIO_set_md, BIO_get_md, BIO_get_md_ctx - message digest BIO filter |
6 | 6 |
7 =head1 SYNOPSIS | 7 =head1 SYNOPSIS |
8 | 8 |
9 #include <openssl/bio.h> | 9 #include <openssl/bio.h> |
10 #include <openssl/evp.h> | 10 #include <openssl/evp.h> |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 BIO is freed. | 51 BIO is freed. |
52 | 52 |
53 After the digest has been retrieved from a digest BIO it must be | 53 After the digest has been retrieved from a digest BIO it must be |
54 reinitialized by calling BIO_reset(), or BIO_set_md() before any more | 54 reinitialized by calling BIO_reset(), or BIO_set_md() before any more |
55 data is passed through it. | 55 data is passed through it. |
56 | 56 |
57 If an application needs to call BIO_gets() or BIO_puts() through | 57 If an application needs to call BIO_gets() or BIO_puts() through |
58 a chain containing digest BIOs then this can be done by prepending | 58 a chain containing digest BIOs then this can be done by prepending |
59 a buffering BIO. | 59 a buffering BIO. |
60 | 60 |
| 61 Before OpenSSL 1.0.0 the call to BIO_get_md_ctx() would only work if the BIO |
| 62 had been initialized for example by calling BIO_set_md() ). In OpenSSL |
| 63 1.0.0 and later the context is always returned and the BIO is state is set |
| 64 to initialized. This allows applications to initialize the context externally |
| 65 if the standard calls such as BIO_set_md() are not sufficiently flexible. |
| 66 |
61 =head1 RETURN VALUES | 67 =head1 RETURN VALUES |
62 | 68 |
63 BIO_f_md() returns the digest BIO method. | 69 BIO_f_md() returns the digest BIO method. |
64 | 70 |
65 BIO_set_md(), BIO_get_md() and BIO_md_ctx() return 1 for success and | 71 BIO_set_md(), BIO_get_md() and BIO_md_ctx() return 1 for success and |
66 0 for failure. | 72 0 for failure. |
67 | 73 |
68 =head1 EXAMPLES | 74 =head1 EXAMPLES |
69 | 75 |
70 The following example creates a BIO chain containing an SHA1 and MD5 | 76 The following example creates a BIO chain containing an SHA1 and MD5 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 | 135 |
130 The lack of support for BIO_puts() and the non standard behaviour of | 136 The lack of support for BIO_puts() and the non standard behaviour of |
131 BIO_gets() could be regarded as anomalous. It could be argued that BIO_gets() | 137 BIO_gets() could be regarded as anomalous. It could be argued that BIO_gets() |
132 and BIO_puts() should be passed to the next BIO in the chain and digest | 138 and BIO_puts() should be passed to the next BIO in the chain and digest |
133 the data passed through and that digests should be retrieved using a | 139 the data passed through and that digests should be retrieved using a |
134 separate BIO_ctrl() call. | 140 separate BIO_ctrl() call. |
135 | 141 |
136 =head1 SEE ALSO | 142 =head1 SEE ALSO |
137 | 143 |
138 TBA | 144 TBA |
OLD | NEW |