Skip to content
  • KJ Tsanaktsidis's avatar
    63e9eaa5
    [ruby/openssl] Fix test_create_with_mac_iter accidently setting keytype not maciter · 63e9eaa5
    KJ Tsanaktsidis authored
    This test was accidentally passing the value 2048 into the keytype
    parameter of PKCS12_create, not the mac_iter parameter (because it had
    one too many `nil`s in the call). This value is invalid, and will make
    OpenSSL perform an out-of-bounds read which is caught when compiling
    with ASAN.
    
    This commit fixes the tests, and also adds some validation to
    PKCS12.create to make sure any keytype passed is actually valid. Since
    there only two valid keytype constants, and the whole feature is an
    export-grade crypto era thing only ever supported by old MSIE, it seems
    far more likely that code in the whild is using keytype similarly by
    mistake rather than as intended. So this validation might catch that.
    
    https://github.com/ruby/openssl/commit/47028686d2
    63e9eaa5
    [ruby/openssl] Fix test_create_with_mac_iter accidently setting keytype not maciter
    KJ Tsanaktsidis authored
    This test was accidentally passing the value 2048 into the keytype
    parameter of PKCS12_create, not the mac_iter parameter (because it had
    one too many `nil`s in the call). This value is invalid, and will make
    OpenSSL perform an out-of-bounds read which is caught when compiling
    with ASAN.
    
    This commit fixes the tests, and also adds some validation to
    PKCS12.create to make sure any keytype passed is actually valid. Since
    there only two valid keytype constants, and the whole feature is an
    export-grade crypto era thing only ever supported by old MSIE, it seems
    far more likely that code in the whild is using keytype similarly by
    mistake rather than as intended. So this validation might catch that.
    
    https://github.com/ruby/openssl/commit/47028686d2
Loading