Commit 002d044
committed
bcrypt: Initialize checksum context on demand with the first update to
properly handle all potential errors. The context is considered uninitialized
if the handle is NULL.
* subversion/libsvn_subr/checksum_bcrypt.c
(bcrypt_ctx_cleanup): Check the handle for NULL. In this case, ignore
cleanup entirely.
(bcrypt_ctx_update, bcrypt_ctx_final): Call initialization if the handle is
NULL.
(bcrypt_ctx_update): Now also requires a pointer to algorithm state to
perform initialization, if needed.
(bcrypt_ctx_reset): Simply set ctx->handle to NULL.
(bcrypt_checksum): Forward algorithm to bcrypt_ctx_update.
(svn_checksum__md5_ctx_create,
svn_checksum__sha1_ctx_create): Remove initialization.
(svn_checksum__md5_ctx_update,
svn_checksum__sha1_ctx_update): Forward algorithm parameter.
git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1931082 13f79535-47bb-0310-9956-ffa450edef681 parent 83af96e commit 002d044
1 file changed
+22
-20
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | | - | |
101 | | - | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
102 | 107 | | |
103 | 108 | | |
104 | 109 | | |
| |||
124 | 129 | | |
125 | 130 | | |
126 | 131 | | |
127 | | - | |
| 132 | + | |
| 133 | + | |
128 | 134 | | |
129 | 135 | | |
130 | 136 | | |
131 | 137 | | |
132 | 138 | | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
133 | 142 | | |
134 | 143 | | |
135 | 144 | | |
| |||
143 | 152 | | |
144 | 153 | | |
145 | 154 | | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
146 | 158 | | |
147 | 159 | | |
148 | 160 | | |
| |||
152 | 164 | | |
153 | 165 | | |
154 | 166 | | |
155 | | - | |
156 | | - | |
| 167 | + | |
157 | 168 | | |
158 | | - | |
159 | | - | |
160 | | - | |
| 169 | + | |
161 | 170 | | |
162 | 171 | | |
163 | 172 | | |
| |||
172 | 181 | | |
173 | 182 | | |
174 | 183 | | |
175 | | - | |
| 184 | + | |
176 | 185 | | |
177 | 186 | | |
178 | 187 | | |
| |||
204 | 213 | | |
205 | 214 | | |
206 | 215 | | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | 216 | | |
212 | 217 | | |
213 | 218 | | |
| |||
225 | 230 | | |
226 | 231 | | |
227 | 232 | | |
228 | | - | |
229 | | - | |
| 233 | + | |
| 234 | + | |
230 | 235 | | |
231 | 236 | | |
232 | 237 | | |
| |||
255 | 260 | | |
256 | 261 | | |
257 | 262 | | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | 263 | | |
263 | 264 | | |
264 | 265 | | |
| |||
276 | 277 | | |
277 | 278 | | |
278 | 279 | | |
279 | | - | |
| 280 | + | |
| 281 | + | |
280 | 282 | | |
281 | 283 | | |
282 | 284 | | |
| |||
0 commit comments