File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -8,8 +8,13 @@ class Engine
88    # The maximum cost supported by the algorithm. 
99    MAX_COST  =  31 
1010    # Maximum possible size of bcrypt() secrets. 
11+     # Older versions of the bcrypt library would truncate passwords longer 
12+     # than 72, but newer ones do not. We truncate like the old library for 
13+     # forward compatibility. This way users upgrading from Ubuntu 18.04 to 20.04 
14+     # will not have their user passwords invalidated, for example. 
15+     # A max secret length greater than 255 leads to bcrypt returning nil. 
1116    # https://github.com/bcrypt-ruby/bcrypt-ruby/issues/225#issuecomment-875908425 
12-     MAX_SECRET_LENGTH  =  255 
17+     MAX_SECRET_LENGTH  =  72 
1318    # Maximum possible size of bcrypt() salts. 
1419    MAX_SALT_LENGTH  =  16 
1520
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments