Skip to content

Commit

Permalink
Added method to decode an attribute with the secret for password vali…
Browse files Browse the repository at this point in the history
…dation, and aliased gen_auth_response_authenticator to gen_acct_response_authenticator.
  • Loading branch information
jimsynz committed Jul 11, 2011
1 parent c7e3a24 commit 3d1597b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/radiustar/packet.rb
Expand Up @@ -85,6 +85,7 @@ def gen_acct_response_authenticator(secret, request_authenticator)
@packed = nil
@authenticator
end
alias :gen_acct_response_authenticator :gen_auth_response_authenticator

def validate_acct_authenticator(secret)
if @authenticator
Expand Down Expand Up @@ -120,6 +121,12 @@ def set_encoded_attribute(name, value, secret)
@attributes[name] = Attribute.new(@dict, name, encode(value, secret))
end

def decode_attribute(name, secret)
if @attributes[name]
decode(@attributes[name].value.to_s, secret)
end
end

def pack
attstr = ""
@attributes.values.each do |attribute|
Expand Down

0 comments on commit 3d1597b

Please sign in to comment.