@@ -28,6 +28,7 @@ function Server(cfg, listener) {
2828 var hostKeys = {
2929 'ssh-rsa' : null ,
3030 'ssh-dss' : null ,
31+ 'ssh-ed25519' : null ,
3132 'ecdsa-sha2-nistp256' : null ,
3233 'ecdsa-sha2-nistp384' : null ,
3334 'ecdsa-sha2-nistp521' : null
@@ -992,11 +993,15 @@ function PKAuthContext(stream, username, service, method, pkInfo, cb) {
992993 this . signature = pkInfo . signature ;
993994 var sigAlgo ;
994995 if ( this . signature ) {
996+ // TODO: move key type checking logic to ssh2-streams
995997 switch ( pkInfo . keyAlgo ) {
996998 case 'ssh-rsa' :
997999 case 'ssh-dss' :
9981000 sigAlgo = 'sha1' ;
9991001 break ;
1002+ case 'ssh-ed25519' :
1003+ sigAlgo = null ;
1004+ break ;
10001005 case 'ecdsa-sha2-nistp256' :
10011006 sigAlgo = 'sha256' ;
10021007 break ;
@@ -1016,8 +1021,9 @@ PKAuthContext.prototype.accept = function() {
10161021 if ( ! this . signature ) {
10171022 this . _initialResponse = true ;
10181023 this . _stream . authPKOK ( this . key . algo , this . key . data ) ;
1019- } else
1024+ } else {
10201025 AuthContext . prototype . accept . call ( this ) ;
1026+ }
10211027} ;
10221028
10231029function HostbasedAuthContext ( stream , username , service , method , pkInfo , cb ) {
@@ -1027,11 +1033,15 @@ function HostbasedAuthContext(stream, username, service, method, pkInfo, cb) {
10271033 this . signature = pkInfo . signature ;
10281034 var sigAlgo ;
10291035 if ( this . signature ) {
1036+ // TODO: move key type checking logic to ssh2-streams
10301037 switch ( pkInfo . keyAlgo ) {
10311038 case 'ssh-rsa' :
10321039 case 'ssh-dss' :
10331040 sigAlgo = 'sha1' ;
10341041 break ;
1042+ case 'ssh-ed25519' :
1043+ sigAlgo = null ;
1044+ break ;
10351045 case 'ecdsa-sha2-nistp256' :
10361046 sigAlgo = 'sha256' ;
10371047 break ;
0 commit comments