This is a fairly nuanced question and warrants a more detailed answer, in my opinion. None of the other answers address passive-aggression. I know this is a lot of information, but I hope it helps some.
- This is, by definition, not rudeness. It is likely either adherence to traditional norms (expecting an introduction via your friend), introversion (a personality trait), professionalism (a set of social norms specific to the workplace), or passive-aggressive behavior (hostility without confrontation).
- Try to give people the benefit of the doubt. If you're going to make an assumption, assume the best possible interpretation of an interaction is true until you find reason to do otherwise.
- Given the above two points: your friend's friend is either old-fashioned (see comments) or an introvert. Either way, I see this as harmless.
These are fairly complex concepts; there's no need to read the entire articles. However, if you want to get better at interpreting people's social behavior, you would do well to understand these things on a basic level.
A display of disrespect by not complying with the social norms or etiquette of a group or culture. Rudeness, particularly with respect to speech, is necessarily confrontational at its core.
The indirect expression of hostility, such as through [...] deliberate [...] failure to accomplish requested tasks for which one is (often explicitly) responsible (i.e. social norms)
Introversion is the state of being predominantly interested in one's own mental self. Introverts are typically perceived as more reserved or reflective. Some popular psychologists have characterized introverts as people whose energy tends to expand through reflection and dwindle during interaction.
Note that while introversion is not necessarily rude or passive-aggressive, the behaviors of introverted people are often interpreted as such, which is why I've defined all three here. It's perhaps the most difficult of the three to understand.
Given the above definitions and what you've described, this does not sound rude to me, as the person in question was not confrontational. It would have been rude to say to you, "What do you want?!", or, "Who's this schmuck?" as those are confrontational.
Turning to your friend and asking for your name could simply be preparation for formalities. If it's in a professional setting, it could simply be the person wanting to address you by your name, know your position/department, or something similar. They wouldn't want to be overly casual with a director or manager, or overly formal with an intern.
If you sensed hostility from the person, passive-aggressive behavior more closely fits the bill in the situation you've described. While it is sadly common among American young people, this is dangerous to assume.
In general, try to give the benefit of the doubt (i.e. take the most positive interpretation in uncertain situations) when meeting new people. I would interpret this as introversion until they display signs of one of the other two descriptions (i.e. rudeness or passive-aggressive). It's quite harsh to judge a person as "unfriendly" in general based on such a short interaction. It depends quite a bit on the context and the person's body language/tone, as others have said. I think you'll know with more certainty which it was once you know the person better.
The "Expected Behavior"
The "proper" thing for this person to do, in modern society, would have been to address you directly with an introduction. Something like:
Hello! I don't believe we've met. I'm CaptainMarvel, and you are?
As pointed out by @StephenR (in the comments), it's more traditional for your friend to make the introduction.