Testimony yesterday by Defense Secretary Caspar W. Weinberger highlighted what may be a lingering legal problem for the Reagan administration as a result of its secret arms deals with Iran: the possibility that two 1985 Israeli shipments of U.S. weapons to Iran violated the Arms Export Control Act.

Weinberger indicated his belief that shipping arms to Iran via Israel would be illegal under the law, a possibility raised earlier this year by the Tower commission, which examined the arms sales. The White House's "legal underpinning" for the sales was "at best highly questionable," the Tower board concluded.

A White House official said this week that administration lawyers have concluded that the law was not broken, but other administration officials besides Weinberger have publicly disagreed.

Last month, Henry Gaffney Jr., an official with the Defense Department's foreign arms sales unit, told the congressional Iran-contra committees that the Israeli shipment in November 1985 of 18 Hawk antiaircraft missiles to Iran appears to have violated the Arms Export Control Act. Gaffney was not asked whether an earlier August-September 1985 Israeli shipment of 508 TOW antitank missiles was illegal, but congressional and other U.S. officials said the evidence suggests that key provisions of the act also were not followed in that sale.

The act requires that any country that has received U.S. arms that proposes to sell those weapons to a third country must be authorized to do so by the president. The law also says that the third-country recipient of U.S. arms in such circumstances must certify that they will be used only for defensive purposes and will not be reexported to a fourth country. Moreover, the third country must be legally able to buy arms directly from the United States to be eligible to buy American weapons indirectly.

Israel had no formal presidential authority to transfer U.S. weapons to Iran, and Iran gave none of the required assurances. Moreover, Iran was the subject of a U.S. arms embargo at the time of the 1985 shipments.

The act carries no criminal penalties, but apparent violations of it could be cited by independent counsel Lawrence E. Walsh in a broader conspiracy charge against officials involved in the secret arms sales.

Evidence presented to the congressional panels has shown that administration concerns about the Arms Export Control Act -- especially a requirement to notify Congress about sales worth more than $14 million -- prompted a January 1986 decision to change the method of transferring arms to Iran. Under the new method, which Weinberger said yesterday he had favored, the administration in 1986 eliminated shipping U.S. arms through Israel and sold them directly through the Central Intelligence Agency.

Attorney General Edwin Meese III has testified that the legal basis for the change stemmed from a 1981 opinion given by his predecessor, William French Smith, who concluded that covert weapons sales arranged through the CIA are exempt from the arms export act.

"Under the Arms Export Control Act, there was a congressional reporting requirement that we wanted to avoid," former national security adviser John M. Poindexter told the congressional Iran-contra panels.

The Arms Export Control Act, which regulates the sale of billions of dollars in U.S. weapons to foreign countries, was enacted in 1976 in part to avoid precisely the type of situation where a major foreign policy decision -- like a controversial arms sale to a country such as Iran -- is made in secret without congressional consultation.

Recognizing the significant impact weapons sales could have on foreign policy, the Senate Foreign Relations Committee, in urging approval of the arms export act in 1976, described U.S. weapons transfers as a "runaway" program that "was not the product of a careful and deliberate policy arrived at through joint action by Congress and the executive branch . . . . Too much of the sales program in the past has been carried out in secrecy."

That language is almost identical to the criticism of the Iran arms sales that has been voiced throughout the congressional hearings by Republican and Democratic members of the select Senate and House Iran-contra panels. Until the arms export act was passed, there was no regular procedure for Congress to receive advance notice of proposed arms sales and it often learned of them after the fact.

Israel's sale of the 508 TOW missiles to Iran in August-September 1985 and the November 1985 shipment of 18 Hawk missiles apparently did not have to be submitted to Congress under the arms export act because both transactions were under $14 million, according to sources familiar with the law.

The failure to comply with the act's eligibility and resale provisions led the Tower panel to conclude that even if President Reagan approved the 1985 Israeli shipments, his consent may not have constituted "adequate legal authority" under the arms export act.

In the case of the November 1985 shipment, some administration officials have argued that any potential violations were overridden by a presidential authorization, known as a "finding," that retroactively approved the CIA's role in assisting Israel in the delivery of the arms to Iran.

The finding retroactively authorizing the CIA's role in the November 1985 shipment was prepared and -- according to Rear Adm. Poindexter -- signed by the president in early December 1985.

However, apparently, no signed copy of that document exists. Poindexter has testified that he destroyed the only copy last Nov. 21, just days before he was forced to resign as national security adviser. Other Cabinet-level officials testified that they never saw or were told of such a finding being signed by Reagan.