@@ -28,6 +28,7 @@ function Server(cfg, listener) {
28
28
var hostKeys = {
29
29
'ssh-rsa' : null ,
30
30
'ssh-dss' : null ,
31
+ 'ssh-ed25519' : null ,
31
32
'ecdsa-sha2-nistp256' : null ,
32
33
'ecdsa-sha2-nistp384' : null ,
33
34
'ecdsa-sha2-nistp521' : null
@@ -992,11 +993,15 @@ function PKAuthContext(stream, username, service, method, pkInfo, cb) {
992
993
this . signature = pkInfo . signature ;
993
994
var sigAlgo ;
994
995
if ( this . signature ) {
996
+ // TODO: move key type checking logic to ssh2-streams
995
997
switch ( pkInfo . keyAlgo ) {
996
998
case 'ssh-rsa' :
997
999
case 'ssh-dss' :
998
1000
sigAlgo = 'sha1' ;
999
1001
break ;
1002
+ case 'ssh-ed25519' :
1003
+ sigAlgo = null ;
1004
+ break ;
1000
1005
case 'ecdsa-sha2-nistp256' :
1001
1006
sigAlgo = 'sha256' ;
1002
1007
break ;
@@ -1016,8 +1021,9 @@ PKAuthContext.prototype.accept = function() {
1016
1021
if ( ! this . signature ) {
1017
1022
this . _initialResponse = true ;
1018
1023
this . _stream . authPKOK ( this . key . algo , this . key . data ) ;
1019
- } else
1024
+ } else {
1020
1025
AuthContext . prototype . accept . call ( this ) ;
1026
+ }
1021
1027
} ;
1022
1028
1023
1029
function HostbasedAuthContext ( stream , username , service , method , pkInfo , cb ) {
@@ -1027,11 +1033,15 @@ function HostbasedAuthContext(stream, username, service, method, pkInfo, cb) {
1027
1033
this . signature = pkInfo . signature ;
1028
1034
var sigAlgo ;
1029
1035
if ( this . signature ) {
1036
+ // TODO: move key type checking logic to ssh2-streams
1030
1037
switch ( pkInfo . keyAlgo ) {
1031
1038
case 'ssh-rsa' :
1032
1039
case 'ssh-dss' :
1033
1040
sigAlgo = 'sha1' ;
1034
1041
break ;
1042
+ case 'ssh-ed25519' :
1043
+ sigAlgo = null ;
1044
+ break ;
1035
1045
case 'ecdsa-sha2-nistp256' :
1036
1046
sigAlgo = 'sha256' ;
1037
1047
break ;
0 commit comments