eu-digital-green-certificates / dgca-businessrule-service

Apache License 2.0
7 stars 24 forks source link

`calcuateHash` strips two leading zeros resulting in incorrect hash value #17

Closed quapka closed 3 years ago

quapka commented 3 years ago

Please, see the #53 in dgc-lib as the exact same bug is present in here and also here.

a-trzewik commented 3 years ago

This is indeed a problem. We will use calculateHash from dgc-lib. The implementation will be updated in dgc-lib.

quapka commented 3 years ago

Yes, overall there are four occurrences of this in three projects (I've created a issue in each of them), so please make sure to fix all of them.

--> ag '== 63'
dgc-lib/src/main/java/eu/europa/ec/dgc/utils/CertificateUtils.java
144:        if (hexString.length() == 63) {

dgc-gateway/src/main/java/eu/europa/ec/dgc/gateway/restapi/filter/CertificateAuthenticationFilter.java
110:                if (hexString.length() == 63) {

dgca-businessrule-service/src/main/java/eu/europa/ec/dgc/businessrule/utils/BusinessRulesUtils.java
48:        if (hexString.length() == 63) {

dgca-businessrule-service/src/main/java/eu/europa/ec/dgc/businessrule/service/GatewayDataDownloadBtpServiceImpl.java
272:            if (hexString.length() == 63) {