Leslie Caldwell knows a thing or two about accounting fraud, having been plucked from her post as criminal chief in the San Francisco U.S. attorney’s office in 2002 to head the Justice Department’s special Enron Task Force.

And Caldwell’s firm, Morgan, Lewis & Bockius, has been a go-to firm for Palo Alto-based Hewlett-Packard Co. The company’s current and former general counsel both hailed from Morgan Lewis, which receives a steady flow of HP’s litigation and transactional work.

So it’s natural the company turned to Caldwell and to Morgan Lewis to deal with the fallout from its $11 billion acquisition of Autonomy, the British software company HP now accuses of cooking its books leading to devastating losses.

But in 2011 during the ill-fated acquisition of Autonomy, Morgan Lewis did not represent HP, a valuable and long-time client. Instead, Morgan Lewis served as an adviser to Autonomy, helping secure approval of the deal from antitrust regulators.

That could raise a sticky set of conflicts for HP and Morgan Lewis as the company prepares to launch and defend an onslaught of legal actions related to HP’s recent announcement it would write down $8.8 billion related to the problem-plagued deal.

Caldwell is now serving as HP’s primary liaison to federal authorities, two attorneys with knowledge confirmed, making the case that Autonomy employees lied about the company’s financial performance. Caldwell, who is based in New York, declined to comment.

HP has called on the Securities and Exchange Commission, the Justice Department and U.K. officials to investigate.

Who will represent HP in what is sure to be years of securities litigation is still unclear. San Diego plaintiffs firms Robbins Geller Rudman & Dowd and Robbins Umeda have already filed class actions on behalf of HP shareholders accusing the company and its accountants of overlooking accounting improprieties by Autonomy and then concealing the division’s poor performance. As of Friday afternoon, no defense lawyers had entered appearances for HP or the other defendants.

More legal action is undoubtedly in the pipeline. In a public statement released Nov. 20, HP alleged “former members of Autonomy’s management team used accounting improprieties, misrepresentations and disclosure failures to inflate the underlying financial metrics of the company.” HP said it would “seek redress against various parties in the appropriate civil courts to recoup what it can for its shareholders.”

Marc Sonnenfeld, a Philadelphia partner and head of securities litigation for Morgan Lewis, would be a usual suspect to defend HP in the securities litigation. So far in 2012, Sonnenfeld knocked out two separate shareholder suits against HP in Delaware and California stemming from the company’s $40 million severance package to outgoing CEO Mark Hurd and alleged bribes to Russian officials.

He also led the team that won dismissal of a securities class action related to HP’s acquisition of Palm Inc. in 2010, though the case has been amended and refiled.

Sonnenfeld would not comment specifically on whether he will be involved in HP’s Autonomy-related litigation.

However, the firm’s prior work for Autonomy should not be a hindrance, he said.

The firm’s work on the deal was limited to antitrust issues and all parties gave consent, Sonnenfeld said.

Moreover, HP now owns Autonomy and has authority to waive any conflict “even if it could possibly be a conflict, which it isn’t,” Sonnenfeld said.

Rory Little, a law professor at UC-Hastings and ethics expert, said transactional lawyers tend to downplay conflicts of interest because everyone is working toward the same goal of striking a deal.

“Silicon Valley has never understood that conflicts rules applied to lawyers in transactions. It’s all been on a handshake and trust,” he added. “But something can always go sour. That’s the reason you’re not supposed to represent both sides in a transaction.”

Regardless of how Morgan Lewis crafted its engagement letter with Autonomy, there is no such thing as “limited” representation of a client, Little said. “It’s like limited pregnancy. They either represent the client or they don’t.”

The Morgan Lewis partner who represented Autonomy on the antitrust concerns, William Myers, is no longer at the firm, perhaps alleviating conflict concerns. However, his work for Autonomy wasn’t a one-time thing.

Myers left Morgan Lewis in September to become general counsel of Palo Alto-based venture capital firm Norwest Venture Partners. Prior to joining Morgan Lewis, Myers worked for the now-defunct Brobeck, Phleger & Harrison, as did Autonomy’s former GC, Andrew Kanter.

Myers, who did not returns calls for comment, also represented Autonomy in its $775 million purchase of a San Jose software firm in 2009 and a $380 million acquisition last year of Boston’s Iron Mountain, a digital archiving, e-discovery and online backup and recovery business.

Advising HP on the HP-Autonomy transaction were lawyers from Gibson, Dunn & Crutcher, another firm with close ties to HP. And Skadden, Arps, Slate, Meagher & Flom represented HP’s board of directors. (Slaughter & May was Autonomy’s primary deal counsel.)

Several lawyers who handle corporate transactions said it isn’t unusual for law firms to have client relationships with parties on both sides of a deal.

The practice is not seen as controversial as long as both parties agree to waive the conflict. A standard conflict waiver might include terms that the law firm sit out of litigation arising from the deal.

There was no such provision in the waivers Morgan Lewis obtained from HP and Autonomy, Sonnenfeld said.

Using a friendly law firm to complete a transaction is often seen as a way to smooth negotiations and get a deal done, which could have been the case in the HP-Autonomy deal, said Samuel Dibble, a corporate transactions partner at Farella Braun & Martel.

Charles Charnas, previously a top in-house lawyer for HP, said considering the company’s close ties to Morgan Lewis, the firm would have “brought a warm hand” to the negotiations as counsel to Autonomy. But Charnas said that doesn’t mean each side’s lawyers wouldn’t do a thorough job of representing their client.”