Enabled bcrypt on Linux. Closes #25.
This commit is contained in:
parent
fd08340b8f
commit
bf80d4bf73
2 changed files with 9 additions and 2 deletions
|
|
@ -9,6 +9,10 @@
|
||||||
import
|
import
|
||||||
os, strutils, times, md5, strtabs, cgi, math, db_sqlite, matchers,
|
os, strutils, times, md5, strtabs, cgi, math, db_sqlite, matchers,
|
||||||
rst, rstgen, captchas, scgi, jester, asyncdispatch, asyncnet, cache, sequtils
|
rst, rstgen, captchas, scgi, jester, asyncdispatch, asyncnet, cache, sequtils
|
||||||
|
|
||||||
|
when not defined(windows):
|
||||||
|
import bcrypt # TODO
|
||||||
|
|
||||||
from htmlgen import tr, th, td, span
|
from htmlgen import tr, th, td, span
|
||||||
|
|
||||||
const
|
const
|
||||||
|
|
@ -221,7 +225,10 @@ proc makeSalt(): string =
|
||||||
|
|
||||||
proc makePassword(password, salt: string): string =
|
proc makePassword(password, salt: string): string =
|
||||||
## Creates an MD5 hash by combining password and salt.
|
## Creates an MD5 hash by combining password and salt.
|
||||||
result = getMD5(salt & getMD5(password))
|
when defined(windows):
|
||||||
|
result = getMD5(salt & getMD5(password))
|
||||||
|
else:
|
||||||
|
result = hash(getMD5(salt & getMD5(password)))
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
template `||`(x: expr): expr = (if not isNil(x): x else: "")
|
template `||`(x: expr): expr = (if not isNil(x): x else: "")
|
||||||
|
|
|
||||||
|
|
@ -8,4 +8,4 @@ license = "MIT"
|
||||||
bin = "forum"
|
bin = "forum"
|
||||||
|
|
||||||
[Deps]
|
[Deps]
|
||||||
Requires: "nimrod >= 0.9.2, cairo#head, jester#head"
|
Requires: "nimrod >= 0.9.2, cairo#head, jester#head, bcrypt#head"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue