• Sotirios Delimanolis's avatar
    Fix OpenSSLUtils::getCommonName to correctly trim trailing null characters · 4892f1bb
    Sotirios Delimanolis authored
    Summary:
    Previously `OpenSSLUtils::getCommonName` was allocating a 64 byte long string and copying the common name from the `X509` into it. We unexpectedly returned that string potentially containing trailing `\0`s.
    
    This diff rewrites the function to allocate a big enough buffer, write to it, then return an appropriately trimmed new string from it.
    
    Reviewed By: yfeldblum
    
    Differential Revision: D22910431
    
    fbshipit-source-id: 77b4fc3ccde4f7ddb0f62b884ecd7ff0c868c1ca
    4892f1bb
OpenSSLUtilsTest.cpp 2.67 KB