Washington (CNN) -- A federal judge has blocked the lead defense attorney for Roger Clemens from questioning Andy Pettitte, the ex-baseball star's longtime teammate and friend, once his client's criminal trial starts in July.

The lawyer, Russell "Rusty" Hardin, acknowledged during a hearing Wednesday that he briefly consulted Pettitte, as well as Clemens, after an independent commission released a report on illegal use of performance enhancing drugs in baseball.

Penned by a group led by former Sen. George Mitchell, the report became the basis of a hearing two months later by the House Committee on Oversight and Government Reform. The two pitchers were among dozens named in its findings.

Clemens last August was indicted on six charges -- one count of obstruction of justice, three of making false statements, and two of perjury -- for lying to Congress during that 2008 hearing, when he denied using steroids, growth hormones or other such performance enhancing drugs.

Pettitte, also a standout pitcher, played alongside Clemens for nine straight years -- with the New York Yankees starting in 1999, then onto Houston for three years beginning in 2004, before returning to New York for one last year in 2007.

He has admitted using growth hormone himself twice, in 2002 and 2004. In a sworn statement to the House committee, he said Clemens admitted using the hormone during a conversation the two had in 1999 or 2000.

Clemens, who won the Cy Young award given to his league's best pitcher seven times, said that Pettitte "misheard" the conversation.

The two men, both native Texans, were close friends before the fall-out from the federal investigation.

The ramifications of the judge's ruling barring Harding from testifying Pettitte does not preclude that pitcher from taking the stand in Clemens' trial. Rather, if prosecutors do call Pettitte to testify as a witness against Clemens, then a second defense attorney -- Michael Attanasio -- will conduct the cross-examination.

Attanasio was hired as part of Clemens' defense team to address the potential conflict. Prosecutors have agreed to the proposal, after the judge determined Attanasio had not been given any information from Hardin's earlier exchanges with Pettitte.

Judge Reggie Walton, of the U.S. District Court in Washington, called Clemens forward during Wednesday's hearing to ask him whether he understood the implications of having an attorney who worked for him, but could not use information he had that might help his defense.

"I do understand that, your honor," Clemens replied.

Meanwhile, the pitcher's defense team has asked the judge to dismiss all or parts of the indictment, claiming mistakes in how the charges are grouped and asserting that the allegations are sometimes too vague to prepare a proper defense.

In court documents, defense attorneys accuse prosecutors of unconstitutional duplicity "by stuffing over a dozen alleged offenses into a single kitchen-sink count."

The judge has yet to rule on the motion for dismissal, and the matter was not addressed during Wednesday's hearing.

Clemens ascended to the majors in 1984, and he played 24 seasons with the Red Sox, the Toronto Blue Jays, the New York Yankees and the Houston Astros.

In addition to Pettitte, prosecutors may also call a former Clemens trainer, Brian McNamee, who told congressional investigators he helped both Clemens and Pettitte use performance-enhancing drugs.

McNamee, who was seated at the same table as Clemens during the 2008 congressional hearing, displayed photographs of soiled medical bandages he said he kept to guard against possible retaliation by Clemens if they were questioned.

During preliminary hearings ahead of the Clemens trial, prosecutors have indicated they have scientific evidence and plan to call an expert witness in the case.