[cmake-developers] file(DOWNLOAD) + EXPECTED_HASH security issue

Daniele E. Domenichelli daniele.domenichelli at gmail.com
Wed Nov 20 04:05:12 EST 2013


On 19/11/13 16:34, Brad King wrote:
>> * The "STATUS" variable is not set, therefore it is not useful;
>> * The "faulty" downloaded file is not removed.
>>
>> So I believe that there is no way to stop CMake, unless you perform
>> another hash check.
>
> The "this->SetError/return false" logic for these errors should be
> replaced by "this->IssueMessage(cmake::FATAL_ERROR,...)/return true"
> to switch it to a fatal error.  The signature should be extended
> to provide an option to get the error information back without
> causing a CMake Error so that the caller can handle it.

What about setting the STATUS variable to
"some number different from 0;<algo> check failed" instead?
In this way the default behaviour won't change and there is no need to
extend the signature, but if you check the STATUS variable, you will be
able to issue a fatal error.
Also if download fails in some other way, the error raised is not fatal,
therefore in this way it looks more coherent.

Daniele



More information about the cmake-developers mailing list