Highly-doped p-type Si is electrochemically etched in an HF-based electrolyte to produce mesoporous surface layers. Using both elastic-recoil detection analysis and secondary ion mass spectroscopy it is concluded that B atoms are not removed from the porous layer. Crystallite size for the most porous samples is related to the average dopant spacing. It is argued that the electrolytic erosion of Si stops when B is in the surface layer and passivated.