Re: [PATCH v6 3/6] KEYS: make partial key id matching as a dedicated function

2014-06-30 Thread Mimi Zohar
On Mon, 2014-06-30 at 16:14 +0300, Dmitry Kasatkin wrote: > On 27/06/14 16:38, David Howells wrote: > > Mimi Zohar wrote: > > > >> + if (strncmp(id, "id:", 3) == 0) > > >> Use memcmp() here. > > 'id' function parameter comes from "keys_ownerid" kernel parameter. > User can supply anything

Re: [PATCH v6 3/6] KEYS: make partial key id matching as a dedicated function

2014-06-30 Thread Dmitry Kasatkin
On 27/06/14 16:38, David Howells wrote: > Mimi Zohar wrote: > >> +if (strncmp(id, "id:", 3) == 0) >> Use memcmp() here. 'id' function parameter comes from "keys_ownerid" kernel parameter. User can supply anything shorter than "id:". Though comparing 3 bytes should not produce any memory

Re: [PATCH v6 3/6] KEYS: make partial key id matching as a dedicated function

2014-06-30 Thread Dmitry Kasatkin
On 27/06/14 16:38, David Howells wrote: Mimi Zohar zo...@linux.vnet.ibm.com wrote: +if (strncmp(id, id:, 3) == 0) Use memcmp() here. 'id' function parameter comes from keys_ownerid kernel parameter. User can supply anything shorter than id:. Though comparing 3 bytes should not produce

Re: [PATCH v6 3/6] KEYS: make partial key id matching as a dedicated function

2014-06-30 Thread Mimi Zohar
On Mon, 2014-06-30 at 16:14 +0300, Dmitry Kasatkin wrote: On 27/06/14 16:38, David Howells wrote: Mimi Zohar zo...@linux.vnet.ibm.com wrote: + if (strncmp(id, id:, 3) == 0) Use memcmp() here. 'id' function parameter comes from keys_ownerid kernel parameter. User can supply

Re: [PATCH v6 3/6] KEYS: make partial key id matching as a dedicated function

2014-06-27 Thread David Howells
Mimi Zohar wrote: > + if (strncmp(id, "id:", 3) == 0) Use memcmp() here. > - kid += kidlen - idlen; > - if (strcasecmp(id, kid) != 0) > - return 0; This test is no longer applied in the ":..." case. David -- To unsubscribe from this list: send the line "unsubscribe

Re: [PATCH v6 3/6] KEYS: make partial key id matching as a dedicated function

2014-06-27 Thread David Howells
Mimi Zohar zo...@linux.vnet.ibm.com wrote: + if (strncmp(id, id:, 3) == 0) Use memcmp() here. - kid += kidlen - idlen; - if (strcasecmp(id, kid) != 0) - return 0; This test is no longer applied in the subtype:... case. David -- To unsubscribe from this list: send

[PATCH v6 3/6] KEYS: make partial key id matching as a dedicated function

2014-06-24 Thread Mimi Zohar
From: Dmitry Kasatkin To avoid code duplication this patch refactors asymmetric_key_match(), making partial ID string match a separate function. This patch also implicitly fixes a bug in the code. asymmetric_key_match() allows to match the key by its subtype. But subtype matching could be

[PATCH v6 3/6] KEYS: make partial key id matching as a dedicated function

2014-06-24 Thread Mimi Zohar
From: Dmitry Kasatkin d.kasat...@samsung.com To avoid code duplication this patch refactors asymmetric_key_match(), making partial ID string match a separate function. This patch also implicitly fixes a bug in the code. asymmetric_key_match() allows to match the key by its subtype. But subtype