mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Updated agents
This commit is contained in:
committed by
Dan Christian Bogos
parent
441ffdcd2e
commit
86ff489008
@@ -158,7 +158,7 @@ func (ar *AgentRequest) Field(fldPath utils.PathItems) (val utils.NMInterface, e
|
||||
case utils.MetaTmp:
|
||||
val, err = ar.tmp.Field(fldPath[1:])
|
||||
case utils.MetaOpts:
|
||||
val, err = ar.tmp.Field(fldPath[1:])
|
||||
val, err = ar.Opts.Field(fldPath[1:])
|
||||
}
|
||||
return
|
||||
}
|
||||
@@ -263,7 +263,7 @@ func (ar *AgentRequest) Set(fullPath *utils.FullPath, nm utils.NMInterface) (add
|
||||
case utils.MetaTmp:
|
||||
return ar.tmp.Set(fullPath.PathItems[1:], nm)
|
||||
case utils.MetaOpts:
|
||||
return ar.diamreq.Set(&utils.FullPath{
|
||||
return ar.Opts.Set(&utils.FullPath{
|
||||
PathItems: fullPath.PathItems[1:],
|
||||
Path: fullPath.Path[6:],
|
||||
}, nm)
|
||||
|
||||
@@ -127,7 +127,7 @@ func radauthReq(flags utils.FlagsWithParams, req *radigo.Packet, aReq *AgentRequ
|
||||
if len(userPassAvps) == 0 {
|
||||
return false, utils.NewErrMandatoryIeMissing(UserPasswordAVP)
|
||||
}
|
||||
if userPassAvps[0].StringValue != nmItems.([]*config.NMItem)[0].Data {
|
||||
if userPassAvps[0].StringValue != (*nmItems.(*utils.NMSlice))[0].Interface() {
|
||||
return false, nil
|
||||
}
|
||||
case flags.HasKey(utils.MetaCHAP):
|
||||
@@ -135,7 +135,7 @@ func radauthReq(flags utils.FlagsWithParams, req *radigo.Packet, aReq *AgentRequ
|
||||
if len(chapAVPs) == 0 {
|
||||
return false, utils.NewErrMandatoryIeMissing(CHAPPasswordAVP)
|
||||
}
|
||||
return radigo.AuthenticateCHAP([]byte(utils.IfaceAsString(nmItems.([]*config.NMItem)[0].Data)),
|
||||
return radigo.AuthenticateCHAP([]byte(utils.IfaceAsString((*nmItems.(*utils.NMSlice))[0].Interface())),
|
||||
req.Authenticator[:], chapAVPs[0].RawValue), nil
|
||||
case flags.HasKey(utils.MetaMSCHAPV2):
|
||||
msChallenge := req.AttributesWithName(MSCHAPChallengeAVP, MicrosoftVendor)
|
||||
@@ -150,7 +150,7 @@ func radauthReq(flags utils.FlagsWithParams, req *radigo.Packet, aReq *AgentRequ
|
||||
vsaMSChallange := msChallenge[0].Value.(*radigo.VSA)
|
||||
|
||||
userName := req.AttributesWithName("User-Name", utils.EmptyString)[0].StringValue
|
||||
passwordFromAttributes := utils.IfaceAsString(nmItems.([]*config.NMItem)[0].Data)
|
||||
passwordFromAttributes := utils.IfaceAsString((*nmItems.(*utils.NMSlice))[0].Interface())
|
||||
|
||||
if len(vsaMSChallange.RawValue) != 16 || len(vsaMSResponde.RawValue) != 50 {
|
||||
return false, nil
|
||||
|
||||
Reference in New Issue
Block a user