Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
fusiondirectory
fusiondirectory-plugins
Commits
0c07fabb
Commit
0c07fabb
authored
Jan 21, 2016
by
Côme Chilliet
Browse files
Fixes
#4385
Ignoring disabled- prefix when parsing SSH keys
parent
d4df85c0
Changes
1
Hide whitespace changes
Inline
Side-by-side
ssh/personal/ssh/class_sshAccount.inc
View file @
0c07fabb
...
@@ -22,14 +22,14 @@
...
@@ -22,14 +22,14 @@
class
SSHPublicKeyAttribute
extends
FileTextAreaAttribute
class
SSHPublicKeyAttribute
extends
FileTextAreaAttribute
{
{
/* cache for key extracted informations */
/* cache for key extracted informations */
protected
$format
=
'/^([-[:alnum:]=",]+\s+)?(ssh-(dss|rsa)|ecdsa-sha2-nistp\d{3})\s+([[:alnum:]+\/.=]+)(\s+([[:graph:][:space:]]+))?\s*$/'
;
protected
$format
=
'/^([-[:alnum:]=",]+\s+)?(
disabled-)?(
ssh-(dss|rsa)|ecdsa-sha2-nistp\d{3})\s+([[:alnum:]+\/.=]+)(\s+([[:graph:][:space:]]+))?\s*$/'
;
function
getArrayValue
()
function
getArrayValue
()
{
{
if
(
preg_match
(
$this
->
format
,
$this
->
value
,
$match
))
{
if
(
preg_match
(
$this
->
format
,
$this
->
value
,
$match
))
{
$fingerprint
=
$this
->
fingerprint
(
base64_decode
(
$match
[
4
]));
$fingerprint
=
$this
->
fingerprint
(
base64_decode
(
$match
[
5
]));
$comment
=
(
isset
(
$match
[
6
])
?
$match
[
6
]
:
''
);
$comment
=
(
isset
(
$match
[
7
])
?
$match
[
7
]
:
''
);
switch
(
$match
[
2
])
{
switch
(
$match
[
3
])
{
case
'ssh-dss'
:
case
'ssh-dss'
:
$type
=
'DSA'
;
$type
=
'DSA'
;
break
;
break
;
...
@@ -37,7 +37,7 @@ class SSHPublicKeyAttribute extends FileTextAreaAttribute
...
@@ -37,7 +37,7 @@ class SSHPublicKeyAttribute extends FileTextAreaAttribute
$type
=
'RSA'
;
$type
=
'RSA'
;
break
;
break
;
default
:
default
:
$type
=
$match
[
2
];
$type
=
$match
[
3
];
break
;
break
;
}
}
return
array
(
return
array
(
...
...
Write
Preview
Supports
Markdown
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