On Fri, Jan 17, 2020 at 11:45:17AM +0100, Tim Düsterhus wrote: > I did not test, but if I am not mistaken this would allow "rfc2253XXX" > as the format parameter, no? Meaning: It allows one to append arbitrary > garbage to the rfc2253 value. > Judging from `smp_check_const_bool` in sample.c a simple strcmp should > be safe to use or you can just use the chunk_strcmp you already use in > `ssl_sock_get_dn_formatted`, I guess. Does Willy have any strong opinion > about this?
I noticed it as well but didn't have enough time to assign to this to look for alternatives, and considered that it was not critical. But if other places already work with an strcmp() that's definitely better indeed. Similarly, we usually prefer to avoid running strcmp() at runtime, so sometimes what's done is that the argument keyword, once parsed, is replaced by an integer that's cheaper to test. I didn't jump on the code to find one example, but I wouldn't be surprized that the json converter or anything else taking a small set of words already does something like this. But here we're dealing with TLS stuff and usually the call rate is very low so I considered that it was not important enough to require another round trip. In general, especially for first submissions, my acceptance level is lower than what some submitters are willing to do, and I prefer not to harrass them and take the patch once it's good enough. But if some want to provide top-most quality patches, they're absolutely welcome to do so! Thanks! Willy

