cose-wg / COSE-C

Implementation of COSE in C++; Provides a C interface; Crypto by openssl or mbedtls
BSD 3-Clause "New" or "Revised" License
30 stars 22 forks source link

Fix error propagation from ECDSA_Sign #49

Closed bergzand closed 6 years ago

bergzand commented 6 years ago

Errors generated in ECDSA_sign() and subcalls are not propagated to the caller of _COSE_Signer_sign(). This PR fixes this in a similar method as used by _COSE_Signer_validate().

How to reproduce:

Supply a signer key cbor map without x and/or y items.

Expected result:

A missing signature and a false returned by COSE_Sign_Sign()

Current result:

A silently missing signature in the resulting COSE sign object. Result from COSE_Sign_Sign() is true

coveralls commented 6 years ago

Coverage Status

Coverage remained the same at 68.732% when pulling accfc1cd2e3410e70ad43487b83a718239b1f599 on bergzand:pr/prop_ecdsa_err into a2ab6d9bfb1f0242c9fe3d84a10ebcfcc64bb296 on cose-wg:master.

coveralls commented 6 years ago

Coverage Status

Coverage remained the same at 68.732% when pulling accfc1cd2e3410e70ad43487b83a718239b1f599 on bergzand:pr/prop_ecdsa_err into a2ab6d9bfb1f0242c9fe3d84a10ebcfcc64bb296 on cose-wg:master.

coveralls commented 6 years ago

Coverage Status

Coverage remained the same at 68.732% when pulling accfc1cd2e3410e70ad43487b83a718239b1f599 on bergzand:pr/prop_ecdsa_err into a2ab6d9bfb1f0242c9fe3d84a10ebcfcc64bb296 on cose-wg:master.

coveralls commented 6 years ago

Coverage Status

Coverage remained the same at 68.732% when pulling accfc1cd2e3410e70ad43487b83a718239b1f599 on bergzand:pr/prop_ecdsa_err into a2ab6d9bfb1f0242c9fe3d84a10ebcfcc64bb296 on cose-wg:master.

coveralls commented 6 years ago

Coverage Status

Coverage remained the same at 68.732% when pulling accfc1cd2e3410e70ad43487b83a718239b1f599 on bergzand:pr/prop_ecdsa_err into a2ab6d9bfb1f0242c9fe3d84a10ebcfcc64bb296 on cose-wg:master.