servo: Merge #16761 - Use hash2 instead of deprecated hash (from Ksbugbee:master); r=jdm

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: 4e3544f05c161039b97fe4c20daca4a0baf372fe

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : c7f59de471905adb648376cc3eb2e1183bc97d80
This commit is contained in:
Ksbugbee 2017-05-08 13:42:32 -05:00
Родитель 0538cf7020
Коммит 49c524ca20
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -4,7 +4,7 @@
use base64;
use net_traits::response::{Response, ResponseBody, ResponseType};
use openssl::hash::{MessageDigest, hash};
use openssl::hash::{MessageDigest, hash2};
use std::iter::Filter;
use std::str::Split;
use std::sync::MutexGuard;
@ -119,7 +119,7 @@ fn apply_algorithm_to_response(body: MutexGuard<ResponseBody>,
message_digest: MessageDigest)
-> String {
if let ResponseBody::Done(ref vec) = *body {
let response_digest = hash(message_digest, vec).unwrap();
let response_digest = hash2(message_digest, vec).unwrap(); //Now hash2
base64::encode(&response_digest)
} else {
unreachable!("Tried to calculate digest of incomplete response body")