Is there a reason that you only cited 2 of the 33 Canons on Justification? Doing so gives the impression that this was all the Council of Trent had to say on the issue and facilitates distortion. The whole of the Canons on Justification paint a much clearer picture. I would suggest you read them all. You will find that the Church teaching is that good works and merit proceed wholly from the Grace of God through the work of Jesus Christ on our behalf and in no way from ourselves. They are necessary but they do not earn salvation, which is by grace alone.
Peace
You should read my comment again. I said "some of the statements" of the councils and then "such as", then gave canon 24 and 32 as examples from Trent. I distorted nothing. If statements from these councils cannot stand alone in defining their intent, then what good are they? The "whole" of the Canons on Justification from Trent - seeing as its primary purpose was to dispute the Reformation definition of justification by faith apart from works - clearly prescribe anathema against the doctrine as taught in Scripture. If, as you say, the Catholic doctrine teaches works "do not earn salvation" because it is by grace alone, then how can they be "necessary"? Aren't you contradicting yourself? And why are Catholics so quick to tag as a sin of "presumption" the assurance a Christian expresses that he can "know he has eternal life" as I John 5:13 promises?
I think I understand now:
We are Saved by GRACE;
but are Kept by WORKS.