[389-devel] Re: How to create a user with certificate with lib389

2019-06-14 Thread William Brown
> On 14 Jun 2019, at 11:25, Viktor Ashirov wrote: > > On Fri, Jun 14, 2019 at 9:28 AM William Brown wrote: >> >> >> >>> On 13 Jun 2019, at 16:09, Viktor Ashirov wrote: >>> >>> On Thu, Jun 13, 2019 at 3:26 PM William Brown wrote: Is the test case *just* testing if binary

[389-devel] Re: How to create a user with certificate with lib389

2019-06-14 Thread Viktor Ashirov
On Fri, Jun 14, 2019 at 9:28 AM William Brown wrote: > > > > > On 13 Jun 2019, at 16:09, Viktor Ashirov wrote: > > > > On Thu, Jun 13, 2019 at 3:26 PM William Brown wrote: > >> > >> Is the test case *just* testing if binary searching of attributes works? > > The test was to check if we can

[389-devel] Re: How to create a user with certificate with lib389

2019-06-14 Thread William Brown
> On 13 Jun 2019, at 16:09, Viktor Ashirov wrote: > > On Thu, Jun 13, 2019 at 3:26 PM William Brown wrote: >> >> Is the test case *just* testing if binary searching of attributes works? > The test was to check if we can query the server for > userCertificate=, where is a string

[389-devel] Re: How to create a user with certificate with lib389

2019-06-13 Thread Viktor Ashirov
On Thu, Jun 13, 2019 at 3:26 PM William Brown wrote: > > Is the test case *just* testing if binary searching of attributes works? The test was to check if we can query the server for userCertificate=, where is a string representation of a base64 encoded x509 certificate. The original test was

[389-devel] Re: How to create a user with certificate with lib389

2019-06-13 Thread William Brown
base64 in ldap is just to transport binary ... so they are one and the same. Either way, I think that you should check ensure str, and provide logs from access and lib389 in verbose to show what the filter generator is doing,a nd what the server is attempting to process so we can see where the

[389-devel] Re: How to create a user with certificate with lib389

2019-06-13 Thread Anuj Borah
Main aim of the test case is filter user with binary search not the base64 . (Pdb) six.ensure_str(crt) *** UnicodeDecodeError: 'utf-8' codec can't decode byte 0x82 in position 1: invalid start byte On Thu, Jun 13, 2019 at 7:05 PM William Brown wrote: > I'm really suspicious here that your

[389-devel] Re: How to create a user with certificate with lib389

2019-06-13 Thread William Brown
I'm really suspicious here that your escape bytes is not needed for ldap as much as to prevent python state leaking into the string and the data. I'm wondering if there is a better approach Can ldap filters take base64 instead? Perhaps the issue with your filter atm is that you are

[389-devel] Re: How to create a user with certificate with lib389

2019-06-13 Thread Anuj Borah
Yes, it is. but with escape_bytes function only. (Pdb) Accounts(standalone, DEFAULT_SUFFIX).filter(f"(userCertificate={crt})") *** ldap.FILTER_ERROR: {'desc': 'Bad search filter', 'errno': 2, 'info': 'No such file or directory'} And finally . Accounts(standalone,

[389-devel] Re: How to create a user with certificate with lib389

2019-06-13 Thread William Brown
Is the test case *just* testing if binary searching of attributes works? > On 13 Jun 2019, at 15:25, Anuj Borah wrote: > > @William Brown > > > This is my test case in bash form . Hope this helps. > > dn: uid=user4F, ou=People, dc=example, dc=com > uid: user4F > cn: User 4F > sn:

[389-devel] Re: How to create a user with certificate with lib389

2019-06-13 Thread Anuj Borah
@William Brown This is my test case in bash form . Hope this helps. dn: uid=user4F, ou=People, dc=example, dc=com uid: user4F cn: User 4F sn: givenName: ou: People objectClass: top objectClass: person objectClass: organizationalPerson objectClass:

[389-devel] Re: How to create a user with certificate with lib389

2019-06-13 Thread William Brown
I'm sorry, you didn't answer my questions can you answer the below questions, exactly and precisely, else I can't help you :( > > * WHAT is the test you are creating? What does it test? How? What steps from > start to finish? Please list this exactly. > * Use SSCA to make the user cert -

[389-devel] Re: How to create a user with certificate with lib389

2019-06-13 Thread Anuj Borah
On Thu, Jun 13, 2019 at 6:05 PM William Brown wrote: > > > > On 13 Jun 2019, at 14:27, Anuj Borah wrote: > > > > > > Okay, so: > > * WHAT is the test you are creating? What does it test? How? What steps > from start to finish? Please list this exactly. > * Use SSCA to make the user cert - it

[389-devel] Re: How to create a user with certificate with lib389

2019-06-13 Thread William Brown
> On 13 Jun 2019, at 14:27, Anuj Borah wrote: > > Okay, so: * WHAT is the test you are creating? What does it test? How? What steps from start to finish? Please list this exactly. * Use SSCA to make the user cert - it creates pem and der copies * Have you looked at:

[389-devel] Re: How to create a user with certificate with lib389

2019-06-13 Thread Anuj Borah
@William Brown Please check the attached test case . I want to put escape_bytes function to lib389 utils.py file . Regards Anuj Borah On Mon, Jun 10, 2019 at 2:18 PM William Brown wrote: > > > > On 9 Jun 2019, at 03:40, Anuj Borah wrote: > > > > @William Brown > > > > Yes, it does. > > >

[389-devel] Re: How to create a user with certificate with lib389

2019-06-10 Thread William Brown
> On 9 Jun 2019, at 03:40, Anuj Borah wrote: > > @William Brown > > Yes, it does. > > Currently i am porting this bug > https://bugzilla.redhat.com/show_bug.cgi?id=170520 > > I think with help of this script it will be impossible to port it . I'm not authorised to view that bug. :) I

[389-devel] Re: How to create a user with certificate with lib389

2019-06-08 Thread Anuj Borah
@William Brown Yes, it does. Currently i am porting this bug https://bugzilla.redhat.com/show_bug.cgi?id=170520 I think with help of this script it will be impossible to port it . Do you have any advice . Regards Anuj Borah On Fri, Jun 7, 2019 at 2:47 PM William Brown wrote: > I haven't

[389-devel] Re: How to create a user with certificate with lib389

2019-06-07 Thread William Brown
I haven't read the link but maybe there is some confusion about TLS binding here. You do the create_rsa_user and that only set's up the certificates. > On 4 Jun 2019, at 17:51, Anuj Borah wrote: > > @William Brown > > Thanks , I am doing the same . Trying to follow it . (i have make this

[389-devel] Re: How to create a user with certificate with lib389

2019-06-04 Thread Anuj Borah
@William Brown Thanks , I am doing the same . Trying to follow it . (i have make this script 99% pass) But its way too old . It uses some like : standalone.nss_ssl.create_rsa_user('testuser') not valid (NssSsl(standalone).create_rsa_user('testuser'))

[389-devel] Re: How to create a user with certificate with lib389

2019-06-04 Thread William Brown
I'm currently traveling at the moment, but I can have a look later to update this to work on latest lib389 etc. You can read it and use it as an example though, even if it doesn't pass ... > On 4 Jun 2019, at 16:32, Anuj Borah wrote: > > @William Brown > > This test script does not pass

[389-devel] Re: How to create a user with certificate with lib389

2019-06-04 Thread Anuj Borah
@William Brown This test script does not pass . Its too old . Regards Anuj Borah On Tue, Jun 4, 2019 at 8:00 PM William Brown wrote: > Have a look at this test case if you want to do usercertificate generation > and authentication :) > > >

[389-devel] Re: How to create a user with certificate with lib389

2019-06-04 Thread William Brown
Have a look at this test case if you want to do usercertificate generation and authentication :) https://pagure.io/389-ds-base/blob/master/f/src/lib389/lib389/tests/tls_external_test.py > On 4 Jun 2019, at 14:31, Anuj Borah wrote: > > Hi all, > > Let say i want to create a user with