This is good idea.
In order to upper case toupper() should be used and not manual guessing.
+ else if (streq (p[0], "x509-username-field") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_GENERAL);
+ /* Uppercase if necessary */
+ {
+ char *s = p[1];
+ int c, flag = 0;
+
+ while ((c = *s) != '\0')
+ {
+ if (c >= 'a' && c <= 'z')
+ {
+ c = c + 'A' - 'a';
+ flag++;
+ }
+ *s = (char) c;
+ s++;
+ }
+ }
+ options->x509_username_field = p[1];
+ }
2010/6/17 Samuli Seppänen <[email protected]>:
>
>> Hi,
>>
>> For my company, we use a PKI (linked to a LDAP) with OpenVPN. We can't
>> use "CN" to be username (few people can have the same "CN"). In our
>> case, we only use the UID.
>>
>> With my patch, you can choose another field to be username with a new
>> option called "x509-username-field", the default value is "CN".
>>
>> Best regards
>>
>> --
>> Emilien Mantel
> Hi Emilien,
>
> Thanks for the patch! Could somebody with better C skills take a look
> and see if it needs modifications?
>
> --
> Samuli Seppänen
> Community Manager
> OpenVPN Technologies, Inc
>
> irc freenode net: mattock
>
>
> ------------------------------------------------------------------------------
> ThinkGeek and WIRED's GeekDad team up for the Ultimate
> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
> lucky parental unit. See the prize list and enter to win:
> http://p.sf.net/sfu/thinkgeek-promo
> _______________________________________________
> Openvpn-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/openvpn-devel
>