Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emulab
emulab-devel
Commits
cd57c6ee
Commit
cd57c6ee
authored
Mar 17, 2004
by
Leigh B. Stoller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add length restriction on keylen.
Add a little bit more output to help in determining why keys get rejected.
parent
55d23a53
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
account/addpubkey.in
account/addpubkey.in
+10
-0
No files found.
account/addpubkey.in
View file @
cd57c6ee
...
...
@@ -245,6 +245,13 @@ exit 1;
sub
ParseKey
($)
{
my
(
$keyline
)
=
@_
;
# Enforce a reasonable length on the key.
if
(
length
(
$keyline
)
>
4096
)
{
print
"
Key is too long!
\n
";
print
"
Key:
$keyline
\n
";
return
0
;
}
if
(
$keyline
=~
/^(\d*\s\d*\s[0-9a-zA-Z]*) ([-\w\@\.]*)$/
)
{
# Protocol 1
$type
=
"
ssh-rsa1
";
...
...
@@ -270,8 +277,11 @@ sub ParseKey($) {
}
if
(
!
defined
(
$key
))
{
print
"
Key cannot be parsed!
\n
";
print
"
Key:
$keyline
\n
";
return
0
;
}
# Do not enter into DB if in verify mode.
if
(
$verify
)
{
print
"
Key was good:
$type
\n
";
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment