SAN FRANCISCO — The enemy of my enemy is my friend. It’s a well-known proverb, but not a common tactic for resolving litigation.

Yet it’s the linchpin of a settlement reached Monday to end securities derivative suits against Hewlett-Packard Co. over its disastrous acquisition of British software firm Autonomy Inc. In exchange for freeing HP officers from claims they ignored red flags in Autonomy’s accounting and hid warning signs from shareholders, plaintiffs attorneys at Cotchett Pitre & McCarthy and Robbins Geller Rudman & Dowd have agreed to team up with HP to go after former Autonomy executives.