adc: fix length detection in password challenge nonce
--HG-- branch : adc
This commit is contained in:
parent
d392cd379d
commit
9e2ce27f08
@ -78,6 +78,7 @@ func (this *AdcProtocol) ProcessCommand(msg string) {
|
||||
}
|
||||
|
||||
this.hc.processEvent(HubEvent{EventType: EVENT_DEBUG_MESSAGE, Message: msg})
|
||||
|
||||
parts := strings.Split(msg, " ")
|
||||
switch parts[0] {
|
||||
|
||||
@ -298,8 +299,8 @@ func (this *AdcProtocol) ProcessCommand(msg string) {
|
||||
*/
|
||||
|
||||
data_base32 := parts[1]
|
||||
if len(data_base32)%5 != 0 {
|
||||
data_base32 += strings.Repeat("=", 6-(len(data_base32)%5))
|
||||
if len(data_base32)%8 != 0 {
|
||||
data_base32 += strings.Repeat("=", 8-(len(data_base32)%8))
|
||||
}
|
||||
|
||||
data_raw, err := base32.StdEncoding.DecodeString(data_base32)
|
||||
|
Loading…
Reference in New Issue
Block a user