-
Notifications
You must be signed in to change notification settings - Fork 4k
x.509 certificate auth mechanism: support (some) SANs of type otherName #2984
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Note that the type by definition contains arbitrary values. According to the OTP types, they are triplets that represent effectively a key/value pair. So we assume the pair is a string that needs a bit massaging, namely stripping the UTF encoding prefix OTP AnotherName decoder leaves in. Kudos to @Thibi2000 for providing an example value. Closes #2983.
x.509 certificate auth mechanism: support (some) SANS of type otherName (cherry picked from commit a4b8664)
Backported to |
There seems to be an issue with using utf8 string as usernames. I tested it with the following username: uþðsername This results in the user being made:
Stripping away the first 2 characters, which are different in this case:
Note that I added another otherName which has the value
which makes me believe that utf8 strings are not supported in rabbit_auth_mechanism_ssl or in the login process of rabbit as a whole. is this the way it is? |
@Thibi2000 you are doing something very niche and specific but making broad generalizations. Usernames in RabbitMQ are sequences of bytes. Some protocols (AMQP 0-9-1 is one example) can have assumptions I haven't tried Unicode usernames. Virtual host names can contain Unicode characters. However, you cannot |
Stripping off the first two bytes is not correct. One value is a type tag, another is length but the length is not encoded as a single byte for obvious length limitation reasons. #2985 changes the parsing mechanism to use whatever the built-in ASN.1/x.509 certificate format parser provides. It requires a value type which we cannot know, so we assume it is I tested it with strings varying from 4 to 390 characters and it works as expected. It obviously won't support |
Using the following otherName = 1.3.6.1.4.1.54392.5.436;FORMAT:UTF8,UTF8String:unicøde-vàlüe I can tell that it is parsed correctly in #2985. It also authenticates when I create a user and grant it some permissions: rabbitmqctl add_user "unicøde-vàlüe"
rabbitmqctl set_permissions -p / "unicøde-vàlüe" ".*" ".*" ".*" |
I do not expect anyone to do this but a Cyrillic value ("кролик") works as well. So as long as the value is of the type |
Note that the type by definition contains arbitrary values. According
to the OTP types, they are triplets that represent effectively
a key/value pair. So we assume the pair is a string that needs a bit
massaging, namely stripping the UTF encoding prefix OTP AnotherName
decoder leaves in.
Kudos to @Thibi2000 for providing an example value.
Closes #2983.