As Hewlett-Packard Co. CEO Meg Whitman was pressed by shareholders and directors fought for their seats on the company’s board, a top lieutenant in the legal department quietly entered the fray.

Rishi Varma was introduced at HP’s annual shareholder meeting last week as the company’s new deputy general counsel for corporate, securities, and M&A, a role he stepped into earlier this month. As HP tries to engineer a turnaround, two of the chief legal issues will be guiding the troubled board and carrying out divestitures to unload some of the company’s far-flung assets, legal watchers say. Both tasks are squarely in the deputy GC’s purview, said Charles Charnas, who held the role before taking a similar job at Apple Inc. in 2008.