diff --git a/common/crypto/sig_public_key.cpp b/common/crypto/sig_public_key.cpp index fdfe73ab..bf071a81 100644 --- a/common/crypto/sig_public_key.cpp +++ b/common/crypto/sig_public_key.cpp @@ -64,17 +64,17 @@ pcrypto::sig::PublicKey::PublicKey( pdo::crypto::BN_CTX_ptr b_ctx(BN_CTX_new(), BN_CTX_free); Error::ThrowIf( - b_ctx == nullptr, "Crypto Error (sig::PrivateKey): Cound not create BN context"); + b_ctx == nullptr, "Crypto Error (sig::PublicKey): Cound not create BN context"); EC_GROUP_ptr group(EC_GROUP_new_by_curve_name(sigDetails_.sslNID), EC_GROUP_clear_free); Error::ThrowIf( - group == nullptr, "Crypto Error (sig::PrivateKey): Cound not create group"); + group == nullptr, "Crypto Error (sig::PublicKey): Cound not create group"); EC_GROUP_set_point_conversion_form(group.get(), POINT_CONVERSION_COMPRESSED); EC_KEY_ptr public_key(EC_KEY_new(), EC_KEY_free); Error::ThrowIf( - public_key == nullptr, "Crypto Error (sig::PrivateKey): Cound not create public_key"); + public_key == nullptr, "Crypto Error (sig::PublicKey): Cound not create public_key"); res = EC_KEY_set_group(public_key.get(), group.get()); Error::ThrowIf( @@ -82,15 +82,15 @@ pcrypto::sig::PublicKey::PublicKey( EC_POINT_ptr point(EC_POINT_new(group.get()), EC_POINT_free); Error::ThrowIf( - point == nullptr, "Crypto Error (sig::PrivateKey): Cound not create point"); + point == nullptr, "Crypto Error (sig::PublicKey): Cound not create point"); res = EC_POINT_oct2point(group.get(), point.get(), numeric_key.data(), numeric_key.size(), b_ctx.get()); Error::ThrowIf( - res <= 0, "Crypto Error (sig::PrivateKey): Cound not convert octet to point"); + res <= 0, "Crypto Error (sig::PublicKey): Cound not convert octet to point"); res = EC_KEY_set_public_key(public_key.get(), point.get()); Error::ThrowIf( - res <= 0, "Crypto Error (sig::PrivateKey): Cound not set public key"); + res <= 0, "Crypto Error (sig::PublicKey): Cound not set public key"); key_ = public_key.get(); public_key.release(); @@ -319,7 +319,7 @@ void pcrypto::sig::PublicKey::GetNumericKey(ByteArray& numeric_key) const pdo::crypto::BN_CTX_ptr b_ctx(BN_CTX_new(), BN_CTX_free); Error::ThrowIf( - b_ctx == nullptr, "Crypto Error (sig::PrivateKey): Cound not create BN context"); + b_ctx == nullptr, "Crypto Error (sig::PublicKey): Cound not create BN context"); const EC_GROUP *group = EC_KEY_get0_group(key_); const EC_POINT *point = EC_KEY_get0_public_key(key_); diff --git a/common/interpreter/wawaka_wasm/WasmCryptoExtensions.cpp b/common/interpreter/wawaka_wasm/WasmCryptoExtensions.cpp index fb5916b5..8eb8fb6c 100644 --- a/common/interpreter/wawaka_wasm/WasmCryptoExtensions.cpp +++ b/common/interpreter/wawaka_wasm/WasmCryptoExtensions.cpp @@ -24,6 +24,7 @@ #include "packages/parson/parson.h" #include "crypto.h" +#include "crypto_shared.h" #include "crypto/verify_ias_report/ias-certificates.h" #include "error.h" #include "jsonvalue.h" @@ -41,10 +42,6 @@ namespace pe = pdo::error; namespace pcrypto = pdo::crypto; -typedef std::unique_ptr BIGNUM_ptr; -typedef std::unique_ptr EC_GROUP_ptr; - - /* ----------------------------------------------------------------- * * NAME: _b64_encode_wrapper * ----------------------------------------------------------------- */