Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
silkaj
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
clients
python
silkaj
Merge requests
!43
Transaction, auth: scrypt parameters now passed with '-n N -r r -p p':
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Transaction, auth: scrypt parameters now passed with '-n N -r r -p p':
tx_rework
into
master
Overview
6
Commits
5
Pipelines
0
Changes
2
Merged
Moul
requested to merge
tx_rework
into
master
8 years ago
Overview
6
Commits
5
Pipelines
0
Changes
2
Expand
#39 (closed)
:
scrypt parameters are optional. No more prompt input.
add checks for good format.
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
d74470d2
5 commits,
7 years ago
2 files
+
27
−
18
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
src/auth.py
+
16
−
11
Options
@@ -5,7 +5,7 @@ import os
def
auth_method
(
c
):
if
c
.
contains_switches
(
'
auth-scrypt
'
):
return
auth_by_scrypt
()
return
auth_by_scrypt
(
c
)
if
c
.
contains_switches
(
'
auth-seed
'
):
return
auth_by_seed
()
if
c
.
contains_switches
(
'
auth-file
'
):
@@ -53,18 +53,23 @@ def auth_by_seed():
return
seed
def
auth_by_scrypt
():
def
auth_by_scrypt
(
c
):
salt
=
input
(
"
Please enter your Scrypt Salt (Secret identifier):
"
)
password
=
getpass
.
getpass
(
"
Please enter your Scrypt password (masked):
"
)
scrypt_param
=
input
(
"
Please enter your Scrypt parameters (N,r,p): default [4096,16,1]:
"
)
if
not
scrypt_param
:
scrypt_param
=
"
4096,16,1
"
scrypt_param_splited
=
scrypt_param
.
split
(
"
,
"
)
n
=
int
(
scrypt_param_splited
[
0
])
r
=
int
(
scrypt_param_splited
[
1
])
p
=
int
(
scrypt_param_splited
[
2
])
if
(
n
<=
0
or
n
>
65536
or
r
<=
0
or
r
>
512
or
p
<=
0
or
p
>
32
):
print
(
"
Error: the values of Scrypt parameters are not good
"
)
if
c
.
contains_definitions
(
'
n
'
)
and
c
.
contains_definitions
(
'
r
'
)
and
c
.
contains_definitions
(
'
p
'
):
n
,
r
,
p
=
c
.
get_definition
(
'
n
'
),
c
.
get_definition
(
'
r
'
),
c
.
get_definition
(
'
p
'
)
if
n
.
isnumeric
()
and
r
.
isnumeric
()
and
p
.
isnumeric
():
n
,
r
,
p
=
int
(
n
),
int
(
r
),
int
(
p
)
if
n
<=
0
or
n
>
65536
or
r
<=
0
or
r
>
512
or
p
<=
0
or
p
>
32
:
print
(
"
Error: the values of Scrypt parameters are not good
"
)
exit
(
1
)
else
:
print
(
"
one of n, r or p is not a number
"
)
exit
(
1
)
else
:
print
(
"
Using default values. Scrypt parameters not specified or wrong format
"
)
n
,
r
,
p
=
4096
,
16
,
1
print
(
"
Scrypt parameters used: N: {0}, r: {1}, p: {2}
"
.
format
(
n
,
r
,
p
))
return
get_seed_from_scrypt
(
salt
,
password
,
n
,
r
,
p
)
Loading