Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix false positives of IS_*() macros for 8-bit ASCII characters #5844

Closed
wants to merge 3 commits into from

Commits on Apr 2, 2018

  1. Make the IS_*() macros work correctly for 8-bit ASCII characters

    Fixes openssl#5778, openssl#5840
    
    The various IS_*() macros did not work correctly for 8-bit ASCII
    characters with the high bit set, because the CVT(a) preprocessor
    macro and'ed the given ASCII value with 0x7F, effectively folding
    the high value range 128-255 over the low value range 0-127.
    As a consequence, some of the IS_*() erroneously returned TRUE.
    
    This commit fixes the issue by mapping CVT(a) to 127 for all values
    a >= 127. This works because the lookup tables CONF_type_default
    and CONF_type_win32 have all bits cleared at entry 127, whence
    IS_*(a) returns FALSE for all values outside the range 0-127.
    
    The IS_*() macros were also changed to return TRUE or FALSE (1 or 0)
    instead of a nonzero or zero value.
    
    Note that with this change, the macro IS_*(c,a) evaluates the 'a'
    argument twice, unless CHARSET_EBCDIC is defined. This prohibits the
    use of arguments with side effects like IS_*(c, *p++).
    mspncp committed Apr 2, 2018
    Configuration menu
    Copy the full SHA
    44a5fd7 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    eacf9fe View commit details
    Browse the repository at this point in the history

Commits on Apr 4, 2018

  1. Enlarge CONF_type_default and CONF_type_win32... [fixup]

    ...to get rid of double argument evaluation in the CVT() macro.
    mspncp committed Apr 4, 2018
    Configuration menu
    Copy the full SHA
    4334a2a View commit details
    Browse the repository at this point in the history