summaryrefslogtreecommitdiff
path: root/openssl/src/sha.rs
diff options
context:
space:
mode:
authorNipunn Koorapati <nipunn@dropbox.com>2020-02-10 12:53:47 -0800
committerNipunn Koorapati <nipunn@dropbox.com>2020-02-10 12:53:51 -0800
commit4898f60e5234bdcab36b1d8924ca51cb6a0f9c7e (patch)
tree87ccc87a3945c8f244a606d3c53d6d3cbcbde1ec /openssl/src/sha.rs
parent62187377b56ef4abf986fffbe30b29a758e8418d (diff)
downloadrust-openssl-4898f60e5234bdcab36b1d8924ca51cb6a0f9c7e.zip
Attach cfg[allow_deprecated] to methods w/ uninitialized functionality
Additionally - update usage of ONCE_INIT
Diffstat (limited to 'openssl/src/sha.rs')
-rw-r--r--openssl/src/sha.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/openssl/src/sha.rs b/openssl/src/sha.rs
index 7f6c4067..0cefaa93 100644
--- a/openssl/src/sha.rs
+++ b/openssl/src/sha.rs
@@ -56,6 +56,7 @@ use std::mem;
/// SHA1 is known to be insecure - it should not be used unless required for
/// compatibility with existing systems.
#[inline]
+#[allow(deprecated)] // https://github.com/rust-lang/rust/issues/63566
pub fn sha1(data: &[u8]) -> [u8; 20] {
unsafe {
let mut hash: [u8; 20] = mem::uninitialized();
@@ -66,6 +67,7 @@ pub fn sha1(data: &[u8]) -> [u8; 20] {
/// Computes the SHA224 hash of some data.
#[inline]
+#[allow(deprecated)] // https://github.com/rust-lang/rust/issues/63566
pub fn sha224(data: &[u8]) -> [u8; 28] {
unsafe {
let mut hash: [u8; 28] = mem::uninitialized();
@@ -76,6 +78,7 @@ pub fn sha224(data: &[u8]) -> [u8; 28] {
/// Computes the SHA256 hash of some data.
#[inline]
+#[allow(deprecated)] // https://github.com/rust-lang/rust/issues/63566
pub fn sha256(data: &[u8]) -> [u8; 32] {
unsafe {
let mut hash: [u8; 32] = mem::uninitialized();
@@ -86,6 +89,7 @@ pub fn sha256(data: &[u8]) -> [u8; 32] {
/// Computes the SHA384 hash of some data.
#[inline]
+#[allow(deprecated)] // https://github.com/rust-lang/rust/issues/63566
pub fn sha384(data: &[u8]) -> [u8; 48] {
unsafe {
let mut hash: [u8; 48] = mem::uninitialized();
@@ -96,6 +100,7 @@ pub fn sha384(data: &[u8]) -> [u8; 48] {
/// Computes the SHA512 hash of some data.
#[inline]
+#[allow(deprecated)] // https://github.com/rust-lang/rust/issues/63566
pub fn sha512(data: &[u8]) -> [u8; 64] {
unsafe {
let mut hash: [u8; 64] = mem::uninitialized();
@@ -116,6 +121,7 @@ pub struct Sha1(ffi::SHA_CTX);
impl Sha1 {
/// Creates a new hasher.
#[inline]
+ #[allow(deprecated)] // https://github.com/rust-lang/rust/issues/63566
pub fn new() -> Sha1 {
unsafe {
let mut ctx = mem::uninitialized();
@@ -136,6 +142,7 @@ impl Sha1 {
/// Returns the hash of the data.
#[inline]
+ #[allow(deprecated)] // https://github.com/rust-lang/rust/issues/63566
pub fn finish(mut self) -> [u8; 20] {
unsafe {
let mut hash: [u8; 20] = mem::uninitialized();
@@ -152,6 +159,7 @@ pub struct Sha224(ffi::SHA256_CTX);
impl Sha224 {
/// Creates a new hasher.
#[inline]
+ #[allow(deprecated)] // https://github.com/rust-lang/rust/issues/63566
pub fn new() -> Sha224 {
unsafe {
let mut ctx = mem::uninitialized();
@@ -172,6 +180,7 @@ impl Sha224 {
/// Returns the hash of the data.
#[inline]
+ #[allow(deprecated)] // https://github.com/rust-lang/rust/issues/63566
pub fn finish(mut self) -> [u8; 28] {
unsafe {
let mut hash: [u8; 28] = mem::uninitialized();
@@ -188,6 +197,7 @@ pub struct Sha256(ffi::SHA256_CTX);
impl Sha256 {
/// Creates a new hasher.
#[inline]
+ #[allow(deprecated)] // https://github.com/rust-lang/rust/issues/63566
pub fn new() -> Sha256 {
unsafe {
let mut ctx = mem::uninitialized();
@@ -208,6 +218,7 @@ impl Sha256 {
/// Returns the hash of the data.
#[inline]
+ #[allow(deprecated)] // https://github.com/rust-lang/rust/issues/63566
pub fn finish(mut self) -> [u8; 32] {
unsafe {
let mut hash: [u8; 32] = mem::uninitialized();
@@ -224,6 +235,7 @@ pub struct Sha384(ffi::SHA512_CTX);
impl Sha384 {
/// Creates a new hasher.
#[inline]
+ #[allow(deprecated)] // https://github.com/rust-lang/rust/issues/63566
pub fn new() -> Sha384 {
unsafe {
let mut ctx = mem::uninitialized();
@@ -244,6 +256,7 @@ impl Sha384 {
/// Returns the hash of the data.
#[inline]
+ #[allow(deprecated)] // https://github.com/rust-lang/rust/issues/63566
pub fn finish(mut self) -> [u8; 48] {
unsafe {
let mut hash: [u8; 48] = mem::uninitialized();
@@ -260,6 +273,7 @@ pub struct Sha512(ffi::SHA512_CTX);
impl Sha512 {
/// Creates a new hasher.
#[inline]
+ #[allow(deprecated)] // https://github.com/rust-lang/rust/issues/63566
pub fn new() -> Sha512 {
unsafe {
let mut ctx = mem::uninitialized();
@@ -280,6 +294,7 @@ impl Sha512 {
/// Returns the hash of the data.
#[inline]
+ #[allow(deprecated)] // https://github.com/rust-lang/rust/issues/63566
pub fn finish(mut self) -> [u8; 64] {
unsafe {
let mut hash: [u8; 64] = mem::uninitialized();