File tree 2 files changed +18
-4
lines changed
2 files changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -843,7 +843,8 @@ automatically set as a listener for the [secureConnection][] event. The
843
843
844
844
- ` sessionIdContext ` : A string containing an opaque identifier for session
845
845
resumption. If ` requestCert ` is ` true ` , the default is MD5 hash value
846
- generated from command-line. Otherwise, the default is not provided.
846
+ generated from command-line. (In FIPS mode a truncated SHA1 hash is
847
+ used instead.) Otherwise, the default is not provided.
847
848
848
849
- ` secureProtocol ` : The SSL method to use, e.g. ` SSLv3_method ` to force
849
850
SSL version 3. The possible values depend on your installation of
Original file line number Diff line number Diff line change @@ -14,6 +14,21 @@ const Timer = process.binding('timer_wrap').Timer;
14
14
const tls_wrap = process . binding ( 'tls_wrap' ) ;
15
15
const TCP = process . binding ( 'tcp_wrap' ) . TCP ;
16
16
const Pipe = process . binding ( 'pipe_wrap' ) . Pipe ;
17
+ const defaultSessionIdContext = getDefaultSessionIdContext ( ) ;
18
+
19
+ function getDefaultSessionIdContext ( ) {
20
+ var defaultText = process . argv . join ( ' ' ) ;
21
+ /* SSL_MAX_SID_CTX_LENGTH is 128 bits */
22
+ if ( process . config . variables . openssl_fips ) {
23
+ return crypto . createHash ( 'sha1' )
24
+ . update ( defaultText )
25
+ . digest ( 'hex' ) . slice ( 0 , 32 ) ;
26
+ } else {
27
+ return crypto . createHash ( 'md5' )
28
+ . update ( defaultText )
29
+ . digest ( 'hex' ) ;
30
+ }
31
+ }
17
32
18
33
function onhandshakestart ( ) {
19
34
debug ( 'onhandshakestart' ) ;
@@ -893,9 +908,7 @@ Server.prototype.setOptions = function(options) {
893
908
if ( options . sessionIdContext ) {
894
909
this . sessionIdContext = options . sessionIdContext ;
895
910
} else {
896
- this . sessionIdContext = crypto . createHash ( 'md5' )
897
- . update ( process . argv . join ( ' ' ) )
898
- . digest ( 'hex' ) ;
911
+ this . sessionIdContext = defaultSessionIdContext ;
899
912
}
900
913
} ;
901
914
You can’t perform that action at this time.
0 commit comments