Support to generate user-password attribute

This commit is contained in:
moznion
2020-11-25 01:04:05 +09:00
parent 84943f10eb
commit 5d5d1dbf68
4 changed files with 60 additions and 10 deletions
+4 -1
View File
@@ -35,10 +35,13 @@ impl Packet {
}
pub fn get_secret(&self) -> &Vec<u8> {
// TODO
&self.secret
}
pub fn get_authenticator(&self) -> &Vec<u8> {
&self.get_authenticator()
}
pub fn parse(bs: &[u8], secret: &[u8]) -> Result<Self, String> {
if bs.len() < 20 {
return Err("radius packet doesn't have enough length of bytes; that has to be at least 20 bytes".to_owned());