Skip to content

Commit 9587367

Browse files
committed
clean up unnecessary changes
1 parent 49e1c6b commit 9587367

File tree

5 files changed

+6
-26
lines changed

5 files changed

+6
-26
lines changed

mbedtls/src/pk/dsa/mod.rs

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -217,13 +217,9 @@ fn sample_secret_value<F: Random>(upper_bound: &Mpi, rng: &mut F) -> Result<Mpi>
217217
Ok(c)
218218
}
219219

220-
pub fn encode_dsa_signature(r: &Mpi, s: &Mpi) -> Result<Vec<u8>> {
221-
serialize_signature(&r.to_binary()?, &s.to_binary()?)
222-
}
223-
224-
pub fn serialize_signature(r: &[u8], s: &[u8]) -> Result<Vec<u8>> {
225-
let r = BigUint::from_bytes_be(r);
226-
let s = BigUint::from_bytes_be(s);
220+
fn encode_dsa_signature(r: &Mpi, s: &Mpi) -> Result<Vec<u8>> {
221+
let r = BigUint::from_bytes_be(&r.to_binary()?);
222+
let s = BigUint::from_bytes_be(&s.to_binary()?);
227223

228224
Ok(yasna::construct_der(|w| {
229225
w.write_sequence(|w| {
@@ -233,18 +229,6 @@ pub fn serialize_signature(r: &[u8], s: &[u8]) -> Result<Vec<u8>> {
233229
}))
234230
}
235231

236-
pub fn deserialize_signature(signature: &Vec<u8>) -> Result<(Vec<u8>, Vec<u8>)> {
237-
let (r,s) = yasna::parse_der(signature, |r| {
238-
r.read_sequence(|rdr| {
239-
let r = rdr.next().read_biguint()?;
240-
let s = rdr.next().read_biguint()?;
241-
Ok((r,s))
242-
})
243-
}).map_err(|_| Error::X509InvalidSignature)?;
244-
245-
Ok((r.to_bytes_be(), s.to_bytes_be()))
246-
}
247-
248232
impl DsaPrivateKey {
249233
pub fn from_components(params: DsaParams, x: Mpi) -> Result<Self> {
250234
if x <= Mpi::new(1)? || x >= params.q {

mbedtls/src/pk/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,8 @@ define!(
211211
// And the key is a const parameter to mbedtls_pk_write_pubkey - ../../../mbedtls-sys/vendor/crypto/library/pkwrite.c:158
212212
//
213213
// - Const access with additional notes due to call stacks involved.
214-
// ecdsa_sign_wrap: ../../../mbedtls-sys/vendor/crypto/library/pk_wrap.c:657
215214
//
215+
// ecdsa_sign_wrap: ../../../mbedtls-sys/vendor/crypto/library/pk_wrap.c:657
216216
// mbedtls_ecdsa_write_signature ../../../mbedtls-sys/vendor/crypto/library/ecdsa.c:688
217217
// mbedtls_ecdsa_write_signature_restartable ../../../mbedtls-sys/vendor/crypto/library/ecdsa.c:640
218218
// MBEDTLS_ECDSA_DETERMINISTIC is not defined.

mbedtls/src/ssl/context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,7 @@ impl<T: IoCallback + Write> Write for Context<T> {
565565
// - no reasonable way to obtain a storage within the sni callback tied to the handshake or to the rust Context. (without resorting to a unscalable map or pointer magic that mbedtls may invalidate)
566566
//
567567
impl HandshakeContext {
568-
pub fn reset_handshake(&mut self) {
568+
fn reset_handshake(&mut self) {
569569
self.handshake_cert.clear();
570570
self.handshake_pk.clear();
571571
self.handshake_ca_cert = None;

mbedtls/src/ssl/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ pub use self::cookie::CookieContext;
2525
pub use self::ticket::TicketContext;
2626
#[cfg(all(feature = "std", feature = "async"))]
2727
#[doc(inline)]
28-
pub use self::context::{AsyncContext};
28+
pub use self::context::AsyncContext;

mbedtls/src/wrapper_macros.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,6 @@ macro_rules! define {
6161
define_struct!(define $(#[$m])* struct $name $(lifetime $l)* inner $inner members $($($(#[$mm])* $member: $member_type,)*)*);
6262
define_struct!(<< $name $(lifetime $l)* inner $inner >> $($defs)*);
6363
};
64-
{ #[c_custom_ty($inner:ident)] $(#[$m:meta])* struct $name:ident$(<$l:tt>)* $({ $($(#[$mm:meta])* $member:ident: $member_type:ty,)* })?; $($defs:tt)* } => {
65-
define_struct!(define_custom $(#[$m])* struct $name $(lifetime $l)* inner $inner members $($($(#[$mm])* $member: $member_type,)*)*);
66-
define_struct!(<< $name $(lifetime $l)* inner $inner >> $($defs)*);
67-
};
6864
// Do not use UnsafeFrom with 'c_box_ty'. That is currently not supported as its not needed anywhere, support may be added in the future if needed anywhere.
6965
{ #[c_box_ty($inner:ident)] $(#[$m:meta])* struct $name:ident$(<$l:tt>)* $({ $($(#[$mm:meta])* $member:ident: $member_type:ty,)* })?; $($defs:tt)* } => {
7066
define_struct!(define_box $(#[$m])* struct $name $(lifetime $l)* inner $inner members $($($(#[$mm])* $member: $member_type,)*)*);

0 commit comments

Comments
 (0)