Transaction failure only when i am using AES GCM ciphertext (NodeJs) #2623
-
Hello. I have been facing this problem for almost two weeks => a commit of transaction error with status ENDORSEMENT_POLICY_FAILURE only when i am trying to persist a object with some attribute related to a ciphertext from the crypto library Basically i am doing this: `
And i am getting this:
Failed to submit transaction: Error: Commit of transaction 7eecf7657a2e3164c08d797db9ff9019f789f753e7bb88a13c6aea7b56a3181e failed on peer peer0.org1.example.com:7051 with status ENDORSEMENT_POLICY_FAILURE But, if I create the ciphertext but do not set inside the vote object, i am able to persist. If I receive this ciphertext from a client (submitTransaction) and then set into the vote object, i am also able to persist. But I really dont wanna to do this on the client side. I am using Hyperledger Fabric 2.1, and I basically just copied the fabcar example, change the name, and start to do some coding on it. Appreciate any help on this. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
What is the endorsement policy? Does it require at least 2 peers? (in example, org1 and org2)?
This would make your ciphertext random. |
Beta Was this translation helpful? Give feedback.
What is the endorsement policy? Does it require at least 2 peers? (in example, org1 and org2)?
Notice that you set a random IV:
let iv = cryptoImported.randomBytes(12);
This would make your ciphertext random.
You can try sending the IV as a chaincode parameter, since the IV is not secret (only the key is).