Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

encrypt/decrypt function require authenticator, which is not easily accessible #11

Closed
MikhailMS opened this issue May 3, 2021 · 1 comment
Assignees
Labels
bug Something isn't working enhancement New feature or request good first issue Good for newcomers

Comments

@MikhailMS
Copy link
Owner

So, right now, if one wants to create a RADIUS packet

  1. Initialise Server/Client
let client = Client::with_dictionary(dictionary)
    .set_server(server)
    .set_secret(secret)
    .set_retries(retries)
    .set_timeout(timeout)
    .set_port(RadiusMsgType::AUTH, auth_port);
  1. Create a list of all RADIUS attributes required
    let attributes = vec![
        client.base_client.create_attribute_by_name("User-Name",          String::from("testing").into_bytes()).unwrap(),
        client.base_client.create_attribute_by_name("NAS-Port-Id",        integer_to_bytes(0)).unwrap(),
        client.base_client.create_attribute_by_name("Service-Type",       integer_to_bytes(2)).unwrap(),
        client.base_client.create_attribute_by_name("NAS-Identifier",     String::from("trillian").into_bytes()).unwrap(),
        client.base_client.create_attribute_by_name("Called-Station-Id",  String::from("00-04-5F-00-0F-D1").into_bytes()).unwrap()
    ];
  1. Create RADIUS packet
let mut auth_packet = client.create_auth_packet(attributes);

==============

However, if one wants to add attributes, that should be encrypted, they need to have an instance of authenticator, which is created inside RADIUS packet, when packet is created (Step 3 above), but RADIUS packet cannot be created without attributes, so such encrypted attribute cannot be easily added to the packet

There are a few ways how this could be resolved, so need to go through options and choose the one that requires minimum changes

@MikhailMS MikhailMS self-assigned this May 3, 2021
@MikhailMS MikhailMS added bug Something isn't working enhancement New feature or request good first issue Good for newcomers labels May 3, 2021
@MikhailMS
Copy link
Owner Author

Fixed in 9883068

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant