xaptum / ecdaa

A C implementation of elliptic-curve-based Direct Anonymous Attestation (DAA) signatures. Created to support the Xaptum Edge Network Fabric, an IoT Network Solution.
https://www.xaptum.com
Apache License 2.0
45 stars 8 forks source link

Be careful comparing CMake strings to empty, in Findsodium #101

Closed zanebeckwith closed 6 years ago

zanebeckwith commented 6 years ago

Findsodium uses the following to see if the user has specified the name of the sodium libraries (I don't know why it allows that, but it does): if (sodium_LIBRARIES STREQUAL "") If this is true, then it sets it to the reasonable default sodium.

The problem is that if sodium_LIBRARIES is not even set, then this is untrue, so sodium_LIBRARIES never gets set, and we call find_library on an unset variable (and thus never find that library).

This fixes that by explicitly augmenting that check to if (NOT DEFINED sodium_LIBRARIES OR sodium_LIBRARIES STREQUAL "")

coveralls commented 6 years ago

Coverage Status

Coverage remained the same at 96.127% when pulling ab97f1aeecfe863c7e5051c18cf6ebfd456ebaad on zanebeckwith:sodium-cmake-str-comp into 8d301678454c445a1cb1cfd51d37f2ecac7b6d61 on xaptum:master.