@it-enterprise/digital-signature 1.3.14 → 1.3.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@it-enterprise/digital-signature",
3
- "version": "1.3.14",
3
+ "version": "1.3.15",
4
4
  "description": "digital signature",
5
5
  "private": false,
6
6
  "main": "src/index.js",
@@ -818,7 +818,12 @@ export default class DigitalSignature {
818
818
  }
819
819
  const signerInfo = await this._euSign.GetSigner(sign, signIndex, false);
820
820
  const cert = Array.isArray(signerInfo) ? signerInfo[0] : signerInfo;
821
- const hashAlgo = cert.infoEx.certHashType || signAlgoToHashAlgo(cert.infoEx.publicKeyType);
821
+ let hashAlgo = cert.infoEx.certHashType || signAlgoToHashAlgo(cert.infoEx.publicKeyType);
822
+
823
+ if (hashAlgo === EndUserConstants.EndUserCertHashType.GOST34311 && this._glSign.HashAlgorithm !== "GOST34311") {
824
+ hashAlgo = EndUserConstants.EndUserHashAlgo.DSTU7564_256;
825
+ }
826
+
822
827
  const hash = await this._euSign.HashData(hashAlgo, data);
823
828
  return await this._euSign.VerifyHash(hash.val || hash, sign.val || sign, signIndex);
824
829
  } else {