allow any string as forgettable field salt
This commit is contained in:
parent
97091fd45f
commit
b4b0d3ff61
@ -721,6 +721,7 @@ async function processDownloadProposalImpl(
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (!isWellFormed) {
|
if (!isWellFormed) {
|
||||||
|
logger.trace(`malformed contract terms: ${j2s(proposalResp.contract_terms)}`);
|
||||||
const err = makeErrorDetails(
|
const err = makeErrorDetails(
|
||||||
TalerErrorCode.WALLET_CONTRACT_TERMS_MALFORMED,
|
TalerErrorCode.WALLET_CONTRACT_TERMS_MALFORMED,
|
||||||
"validation for well-formedness failed",
|
"validation for well-formedness failed",
|
||||||
|
@ -165,14 +165,6 @@ export namespace ContractTermsUtil {
|
|||||||
if (typeof fv !== "string") {
|
if (typeof fv !== "string") {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
try {
|
|
||||||
const decFv = decodeCrock(fv);
|
|
||||||
if (decFv.length != 32) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else if (k === "$forgotten") {
|
} else if (k === "$forgotten") {
|
||||||
const fgo = anyJson.$forgotten;
|
const fgo = anyJson.$forgotten;
|
||||||
@ -230,7 +222,6 @@ export namespace ContractTermsUtil {
|
|||||||
export function hashContractTerms(contractTerms: unknown): string {
|
export function hashContractTerms(contractTerms: unknown): string {
|
||||||
const cleaned = scrub(contractTerms);
|
const cleaned = scrub(contractTerms);
|
||||||
const canon = canonicalJson(cleaned) + "\0";
|
const canon = canonicalJson(cleaned) + "\0";
|
||||||
console.warn(`canon '${canon}'`)
|
|
||||||
return encodeCrock(hash(stringToBytes(canon)));
|
return encodeCrock(hash(stringToBytes(canon)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user