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
impl NTLMv2SecurityInterface
Sourcepub fn new(
encrypt: Rc4,
decrypt: Rc4,
signing_key: Vec<u8>,
verify_key: Vec<u8>,
) -> Self
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
impl GenericSecurityService for NTLMv2SecurityInterface
Source§fn gss_wrapex(&mut self, data: &[u8]) -> RdpResult<Vec<u8>>
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>>
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§
impl Freeze for NTLMv2SecurityInterface
impl RefUnwindSafe for NTLMv2SecurityInterface
impl Send for NTLMv2SecurityInterface
impl Sync for NTLMv2SecurityInterface
impl Unpin for NTLMv2SecurityInterface
impl UnwindSafe for NTLMv2SecurityInterface
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more