Section III : Enemy vessels and aircraft exempt from attackBolding is mine. This was, from the very beginning, described as a humanitarian mission. Even the Israelis don't substantially dispute that. This was absolutely a "relief action". Section 67, the part with the blockade exemptions, specifically states that it is subject to these "basic rules".
Classes of vessels exempt from attack
47. The following classes of enemy vessels are exempt from attack:
(a) hospital ships;
(b) small craft used for coastal rescue operations and other medical transports;
(c) vessels granted safe conduct by agreement between the belligerent parties including:
(i) cartel vessels, e.g., vessels designated for and engaged in the transport of prisoners of war;
(ii) vessels engaged in humanitarian missions, including vessels carrying supplies indispensable to the survival of the civilian population, and vessels engaged in relief actions and rescue operations.
Therefore, the assault was not legal. Period.
Edit: It should also be noted that any blockade is not legitimate if—as stated by section 102 of the treaty—it has the sole purpose of starving the civilian population or denying it other objects essential for its survival; or the damage to the civilian population is, or may be expected to be, excessive in relation to the concrete and direct military advantage anticipated from the blockade.
Considering that the Gazan economy has been effectively destroyed by the blockade, and that they cannot even get fresh food, it is clear that the blockade is both excessive and dangerous. Section 102 applies.
Re-Edit: Ah. The "basic rules" are 38-46, not 47. That said, the boats were inspected at neutral ports to ensure that they were not carrying contraband, and were still a humanitarian mission, NOT "neutral merchants", which is what 67 is about. But technically 47 requires agreement between the belligerent parties, so it might come under 67 instead of 47. If that's the case, they could be raided for "contraband". So what IS contraband? Well...
148. Contraband is defined as goods which are ultimately destined for territory under the control of the enemy and which may be susceptible for use in armed conflict.Now, it may be argued that building materials might be contraband under 150(c), but we're talking about basic things like concrete here, and apparently the ships didn't even include that sort of thing. (The Israelis said that nothing on the ships was actually prohibited. Ironic, that.)
149. In order to exercise the right of capture referred to in paragraphs 146(a) and 147, the belligerent must have published contraband lists. The precise nature of a belligerent's contraband list may vary according to the particular circumstances of the armed conflict. Contraband lists shall be reasonably specific.
150. Goods not on the belligerent's contraband list are 'free goods', that is, not subject to capture. As a minimum, 'free goods' shall include the following:
(b) articles intended exclusively for the treatment of the wounded and sick and for the prevention of disease;
(c) clothing, bedding, essential foodstuffs, and means of shelter for the civilian population in general, and women and children in particular, provided there is not serious reason to believe that such goods will be diverted to other purpose, or that a definite military advantage would accrue to the enemy by their substitution for enemy goods that would thereby become available for military purposes;
(f) other goods not susceptible for use in armed conflict
More importantly, however, paragraph 149 requires "published contraband lists". From what I've seen, there aren't any. Israel has been very closemouthed about what it does and doesn't consider contraband. It was like pulling teeth to find out that things like spices and fresh meat aren't allowed.
So even if the blockade were legal, which it isn't...
...Israel would still have no right to attack and capture!