Struct NTLMv2SecurityInterface

Source
pub struct NTLMv2SecurityInterface { /* private fields */ }
Expand description

This object is used by CSSP layer to abstract NTLMv2 implementation

NTLMv2 use RC4 as main crypto algorithm

Implementations§

Source§

impl NTLMv2SecurityInterface

Source

pub fn new( encrypt: Rc4, decrypt: Rc4, signing_key: Vec<u8>, verify_key: Vec<u8>, ) -> Self

Create a new NTLMv2 security interface

§Example
extern crate crypto;
use rdp::nla::ntlm::NTLMv2SecurityInterface;
use crypto::rc4::Rc4;
let interface = NTLMv2SecurityInterface::new(Rc4::new(b"encrypt"), Rc4::new(b"decrypt"), b"signing".to_vec(), b"verify".to_vec());

Trait Implementations§

Source§

impl GenericSecurityService for NTLMv2SecurityInterface

Source§

fn gss_wrapex(&mut self, data: &[u8]) -> RdpResult<Vec<u8>>

This is the main encrypt function This will also compute the signing

§Example
extern crate crypto;
use rdp::nla::ntlm::NTLMv2SecurityInterface;
use crypto::rc4::Rc4;
use rdp::nla::sspi::GenericSecurityService;
let mut interface = NTLMv2SecurityInterface::new(Rc4::new(b"encrypt"), Rc4::new(b"decrypt"), b"signing".to_vec(), b"verify".to_vec());
assert_eq!(interface.gss_wrapex(b"foo").unwrap(), [1, 0, 0, 0, 142, 146, 37, 160, 247, 244, 100, 58, 0, 0, 0, 0, 87, 164, 208]);
assert_eq!(interface.gss_wrapex(b"foo").unwrap(), [1, 0, 0, 0, 162, 95, 77, 158, 159, 36, 8, 240, 1, 0, 0, 0, 153, 3, 250])
Source§

fn gss_unwrapex(&mut self, data: &[u8]) -> RdpResult<Vec<u8>>

This is the main decrypt function use by the cssp manager to decrypt messages comming from server

§Example
extern crate crypto;
use rdp::nla::ntlm::NTLMv2SecurityInterface;
use crypto::rc4::Rc4;
use rdp::nla::sspi::GenericSecurityService;
let mut interface = NTLMv2SecurityInterface::new(Rc4::new(b"decrypt"), Rc4::new(b"encrypt"), b"verify".to_vec(), b"signing".to_vec());
assert_eq!(interface.gss_unwrapex(&vec![1, 0, 0, 0, 142, 146, 37, 160, 247, 244, 100, 58, 0, 0, 0, 0, 87, 164, 208]).unwrap(), b"foo");
assert_eq!(interface.gss_unwrapex(&vec![1, 0, 0, 0, 162, 95, 77, 158, 159, 36, 8, 240, 1, 0, 0, 0, 153, 3, 250]).unwrap(), b"foo")

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V