The swab was typed for hsv1, correct?
If your bf was your only sexual partner, then yes, he gave it to you. It does not take a visible cold sore (doesn't your bf get cold sores?) or visible genital symptoms to transmit herpes - we shed the virus even when there are no lesions.
Assuming he gave it to you, you two don't need to take any additional measure to avoid transmission. That's because he won't catch something that he already has. Of course we also suggest avoiding sexual contact when there's a outbreak, just to err on the side of caution.
The doctor took a swab of one of the sores.