Setup verification algorithm if not provided 73/202873/3
authorKrzysztof Jackiewicz <k.jackiewicz@samsung.com>
Fri, 5 Apr 2019 09:44:10 +0000 (11:44 +0200)
committerTomasz Swierczek <t.swierczek@samsung.com>
Mon, 20 May 2019 09:08:01 +0000 (11:08 +0200)
Verification API has no knowledge about the algorithm type. It has to be derived
from the key type.

Change-Id: I2e0d094372e4bf8c28275544204e431c4023e391

src/manager/crypto/tz-backend/obj.cpp

index 81aabaa..351f24e 100644 (file)
@@ -85,7 +85,7 @@ int AKey::verify(const CryptoAlgorithm &alg, const RawBuffer &message,
 
        // setup algorithm type basing on key type if it doesn't exist
        if (!algWithType.getParam(ParamName::ALGO_TYPE, type)) {
-               ThrowErr(Exc::Crypto::InputParam, "Invalid key type: ", "not given");
+               algWithType.setParam(ParamName::ALGO_TYPE, key2algo(m_type));
        }
 
        return Internals::verify(getBinary(), getPassword(), algWithType, message, sign);