node-radius icon indicating copy to clipboard operation
node-radius copied to clipboard

encode: invalid attributes - must give buffer for unknown attribute 'WISPr-Bandwitdth-Max-Down'

Open nkarabulut381 opened this issue 3 years ago • 7 comments

I want to add WISPr dictionary but I get encoding error.

I added file dictionary.wispr in dictionary folder

https://opensource.apple.com/source/freeradius/freeradius-11/freeradius/share/dictionary.wispr.auto.html

nkarabulut381 avatar Dec 25 '21 20:12 nkarabulut381

Looks like you have a typo in WISPr-Bandwitdth-Max-Down (should be WISPr-Bandwidth-Max-Down).

muirdm avatar Dec 25 '21 20:12 muirdm

The typo here doesn't matter. Including the dictionary, but the attributes is not working.

nkarabulut381 avatar Dec 25 '21 20:12 nkarabulut381

Can you show the code you are using to try to load the dictionary and use the attribute?

muirdm avatar Dec 25 '21 21:12 muirdm

I am copying Dictionary.wispr which is the link to the radius/dictionary folder. I'm not doing anything else. because it needs to pull directly from that folder.

How do you think it should be?

nkarabulut381 avatar Dec 25 '21 21:12 nkarabulut381

var dictionary_locations = [path.normalize(__dirname + "/../dictionaries")];

nkarabulut381 avatar Dec 25 '21 21:12 nkarabulut381

You need to show your code if you want help. The dictionary works fine for me:

var radius = require('radius');

radius.add_dictionary('wispr.dict');

var packet = radius.encode({
  code: "Access-Request",
  secret: "obsidian order",
  attributes: [
    ['Vendor-Specific', 'WISPr', [['WISPr-Bandwidth-Max-Down', 1234]]],
  ]
});

muirdm avatar Dec 26 '21 00:12 muirdm

It worked this way. I just get the "Unknown Vendor" warning.

thanks

nkarabulut381 avatar Dec 26 '21 07:12 nkarabulut381