Skip to content

Commit be3e8a2

Browse files
committed
ns_hotp: aligned name of variable with documentation
1 parent c2c6107 commit be3e8a2

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

simple-config.tcl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ ns_section ns/servers {
1414
ns_section ns/server/default/adp {
1515
ns_param map /*.adp
1616
}
17+
if {1} {
1718
ns_section ns/server/default/modules {
1819
#ns_param nscp nscp
1920
ns_param nssock nssock
@@ -23,3 +24,11 @@ ns_section ns/server/default/module/nssock {
2324
ns_param address 0.0.0.0
2425
ns_param port 8000
2526
}
27+
} else {
28+
ns_section ns/modules { ns_param nssock nssock }
29+
ns_section ns/module/nssock {
30+
ns_param address 0.0.0.0
31+
ns_param port 8000
32+
}
33+
}
34+
#ns_logctl severity Debug(ns:driver) on

tcl/ns_crypto.tcl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,9 @@ nsf::proc ns_hotp {
151151
{-digest sha256}
152152
{-digits:integer 6}
153153
{-key ""}
154-
data
154+
counter
155155
} {
156-
set hmac [::ns_crypto::hmac string -digest $digest $key $data]
156+
set hmac [::ns_crypto::hmac string -digest $digest $key $counter]
157157
return [::ns_crypto::hotp_truncate -digits $digits $hmac]
158158
}
159159

tests/ns_crypto.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ test pbkdf2_hmac-sha256.5 {Testcase 4 for pbkdf2-hmac-sha256, forcing a differen
370370

371371
test ns_hotp-1.0 {syntax: ns_hotp} -constraints {crypto nsf} -body {
372372
ns_hotp x y
373-
} -returnCodes error -result {invalid argument 'y', maybe too many arguments; should be "ns_hotp ?-digest /value/? ?-digits /integer/? ?-key /value/? /data/"}
373+
} -returnCodes error -result {invalid argument 'y', maybe too many arguments; should be "ns_hotp ?-digest /value/? ?-digits /integer/? ?-key /value/? /counter/"}
374374

375375
test hotp-1.1 {
376376

0 commit comments

Comments
 (0)