<div dir="ltr">Thanks! By the way, I think it's worth updating the man pages with the summary of this. Some of the naming conventions and algorithm names are unclear unless you investigate by trial and error and/or looking at the source code.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jun 23, 2017 at 5:35 PM, Andrew Cagney <span dir="ltr"><<a href="mailto:andrew.cagney@gmail.com" target="_blank">andrew.cagney@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">For reference,<br>
<br>
FYI, I came up with the following additions.  While I don't think<br>
aes_gcm_256 is valid, aes_gcm_16_256 certainly is :-/<br>
<br>
@@ -104,10 +104,36 @@<br>
 [esp=aes_gcm_c-128-null]      OK: AES_GCM_C(20)_128-NONE(0)<br>
 [esp=aes_gcm_c-192-null]      OK: AES_GCM_C(20)_192-NONE(0)<br>
 [esp=aes_gcm_c-256-null]      OK: AES_GCM_C(20)_256-NONE(0)<br>
+[esp=aes_ccm_a-null]          OK: AES_CCM_A(14)_000-NONE(0)<br>
+[esp=aes_ccm_b-null]          OK: AES_CCM_B(15)_000-NONE(0)<br>
+[esp=aes_ccm_c-null]          OK: AES_CCM_C(16)_000-NONE(0)<br>
+[esp=aes_gcm_a-null]          OK: AES_GCM_A(18)_000-NONE(0)<br>
+[esp=aes_gcm_b-null]          OK: AES_GCM_B(19)_000-NONE(0)<br>
+[esp=aes_gcm_c-null]          OK: AES_GCM_C(20)_000-NONE(0)<br>
 [esp=aes_ccm-null]            OK: AES_CCM_C(16)_000-NONE(0)<br>
 [esp=aes_gcm-null]            OK: AES_GCM_C(20)_000-NONE(0)<br>
 [esp=aes_ccm-256-null]        OK: AES_CCM_C(16)_256-NONE(0)<br>
 [esp=aes_gcm-192-null]        OK: AES_GCM_C(20)_192-NONE(0)<br>
+[esp=aes_ccm_256-null]     ERROR: ESP encryption algorithm 'aes_ccm_'<br>
is not recognized, enc_alg="aes_ccm_"(256), auth_alg="null", modp=""<br>
+[esp=aes_gcm_192-null]     ERROR: ESP encryption algorithm 'aes_gcm_'<br>
is not recognized, enc_alg="aes_gcm_"(192), auth_alg="null", modp=""<br>
+[esp=aes_ccm_8-null]       ERROR: ESP encryption algorithm 'aes_ccm_'<br>
is not recognized, enc_alg="aes_ccm_"(8), auth_alg="null", modp=""<br>
+[esp=aes_ccm_12-null]      ERROR: ESP encryption algorithm 'aes_ccm_'<br>
is not recognized, enc_alg="aes_ccm_"(12), auth_alg="null", modp=""<br>
+[esp=aes_ccm_16-null]      ERROR: ESP encryption algorithm 'aes_ccm_'<br>
is not recognized, enc_alg="aes_ccm_"(16), auth_alg="null", modp=""<br>
+[esp=aes_gcm_8-null]       ERROR: ESP encryption algorithm 'aes_gcm_'<br>
is not recognized, enc_alg="aes_gcm_"(8), auth_alg="null", modp=""<br>
+[esp=aes_gcm_12-null]      ERROR: ESP encryption algorithm 'aes_gcm_'<br>
is not recognized, enc_alg="aes_gcm_"(12), auth_alg="null", modp=""<br>
+[esp=aes_gcm_16-null]      ERROR: ESP encryption algorithm 'aes_gcm_'<br>
is not recognized, enc_alg="aes_gcm_"(16), auth_alg="null", modp=""<br>
+[esp=aes_ccm_8-128-null]   ERROR: Non alpha char found after enc<br>
keylen end separator, just after "aes_ccm_8-" (state=ST_EK_END)<br>
+[esp=aes_ccm_12-192-null]  ERROR: Non alpha char found after enc<br>
keylen end separator, just after "aes_ccm_12-" (state=ST_EK_END)<br>
+[esp=aes_ccm_16-256-null]  ERROR: Non alpha char found after enc<br>
keylen end separator, just after "aes_ccm_16-" (state=ST_EK_END)<br>
+[esp=aes_gcm_8-128-null]   ERROR: Non alpha char found after enc<br>
keylen end separator, just after "aes_gcm_8-" (state=ST_EK_END)<br>
+[esp=aes_gcm_12-192-null]  ERROR: Non alpha char found after enc<br>
keylen end separator, just after "aes_gcm_12-" (state=ST_EK_END)<br>
+[esp=aes_gcm_16-256-null]  ERROR: Non alpha char found after enc<br>
keylen end separator, just after "aes_gcm_16-" (state=ST_EK_END)<br>
+[esp=aes_ccm_8_128-null]   ERROR: Non digit or valid separator found<br>
while reading enc keylen, just after "aes_ccm_8" (state=ST_EK)<br>
+[esp=aes_ccm_12_192-null]  ERROR: Non digit or valid separator found<br>
while reading enc keylen, just after "aes_ccm_12" (state=ST_EK)<br>
+[esp=aes_ccm_16_256-null]  ERROR: Non digit or valid separator found<br>
while reading enc keylen, just after "aes_ccm_16" (state=ST_EK)<br>
+[esp=aes_gcm_8_128-null]   ERROR: Non digit or valid separator found<br>
while reading enc keylen, just after "aes_gcm_8" (state=ST_EK)<br>
+[esp=aes_gcm_12_192-null]  ERROR: Non digit or valid separator found<br>
while reading enc keylen, just after "aes_gcm_12" (state=ST_EK)<br>
+[esp=aes_gcm_16_256-null]  ERROR: Non digit or valid separator found<br>
while reading enc keylen, just after "aes_gcm_16" (state=ST_EK)<br>
 [esp=aes_ctr]                 OK: AES_CTR(13)_000-MD5(1),<br>
AES_CTR(13)_000-SHA1(2)<br>
 [esp=aesctr]                  OK: AES_CTR(13)_000-MD5(1),<br>
AES_CTR(13)_000-SHA1(2)<br>
 [esp=aes_ctr128]              OK: AES_CTR(13)_128-MD5(1),<br>
AES_CTR(13)_128-SHA1(2)<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
On 23 June 2017 at 10:08, Andrew Cagney <<a href="mailto:andrew.cagney@gmail.com">andrew.cagney@gmail.com</a>> wrote:<br>
> On 23 June 2017 at 02:39, Oleg Rosowiecki <<a href="mailto:orosowiecki@gmail.com">orosowiecki@gmail.com</a>> wrote:<br>
>> Thanks! I noticed recent changes to this code but didn't have a chance to<br>
>> analyze them.<br>
>><br>
>> There is another similar problem with the parser: ealg_getbyname_or_alias()<br>
>> has these aliases for AEAD algorithms:<br>
><br>
>> aes_ccm_a -- aes_ccm_8<br>
>> aes_ccm_b -- aes_ccm_12<br>
>> ...<br>
>> aes_gcm_c -- aes_gcm_16<br>
>><br>
>> If you try to use any of these aliases, parser_machine() will complain. The<br>
>> reason is that the parser immediately switches to key length processing<br>
>> (ST_EK) if it encounters a digit right after the algorithm name ("bravely<br>
>> switch to enc keylen" is the comment :)).<br>
><br>
> Ah!  I'd noticed that algparse.c contains tests for those but they<br>
> were commented out (and fail when enabled) so left it at that.  Thanks<br>
> for pointing out the cause.<br>
><br>
> BTW, post 3.21 testing should get easier, vis:<br>
><br>
> $ ./OBJ.linux.x86_64/programs/<wbr>algparse/algparse aes_ccm_a aes_ccm_8<br>
> [ike=aes_ccm_a] ERROR: IKE encryption algorithm 'aes_ccm_a' is not<br>
> implemented, enc_alg="aes_ccm_a"(0), auth_alg="", modp=""<br>
> [ ah=aes_ccm_a] ERROR: AH integrity algorithm 'aes_ccm_a' is not<br>
> recognized, enc_alg=""(0), auth_alg="aes_ccm_a", modp=""<br>
> [esp=aes_ccm_a]    OK: AES_CCM_A(14)_000-NONE(0)<br>
> [ike=aes_ccm_8] ERROR: IKE encryption algorithm 'aes_ccm_' is not<br>
> recognized, enc_alg="aes_ccm_"(8), auth_alg="", modp=""<br>
> [ ah=aes_ccm_8] ERROR: AH integrity algorithm 'aes_ccm_8' is not<br>
> recognized, enc_alg=""(0), auth_alg="aes_ccm_8", modp=""<br>
> [esp=aes_ccm_8] ERROR: ESP encryption algorithm 'aes_ccm_' is not<br>
> recognized, enc_alg="aes_ccm_"(8), auth_alg="", modp=""<br>
><br>
><br>
>> This is probably not as important as fixing the DH group, but still it<br>
>> doesn't work as intended. Worth fixing, too, IMO.<br>
>><br>
>> On Fri, Jun 23, 2017 at 2:36 AM, Andrew Cagney <<a href="mailto:andrew.cagney@gmail.com">andrew.cagney@gmail.com</a>><br>
>> wrote:<br>
>>><br>
>>> On 22 June 2017 at 19:04, Oleg Rosowiecki <<a href="mailto:orosowiecki@gmail.com">orosowiecki@gmail.com</a>> wrote:<br>
>>> > Speaking of the algorithm rename... Is there any reason behind accepting<br>
>>> > only the value of "dh21" for ike= and allowing only "ecp_521" for<br>
>>> > phase2alg?<br>
>>><br>
>>> I didn't know about that quirk - the recent changes have been unifying<br>
>>> the lookup while largely ignoring the parser.  The final round will be<br>
>>> merged post 3.21.<br>
>>><br>
>>> A quick test shows the current code behaves as follows:<br>
>>><br>
>>> ike:<br>
>>> [       aes-sha1;dh21]    OK: AES_CBC(7)_000-SHA1(2)-ECP_<wbr>521(21)<br>
>>> esp:<br>
>>> [       aes-sha1;dh21]    OK: AES(12)_000-SHA1(2); pfsgroup=ECP_521(21)<br>
>>><br>
>>> but:<br>
>>><br>
>>> ike/esp:<br>
>>> [    aes-sha1;ecp_521] ERROR: Non alphanum char found after in modp<br>
>>> string, just after "aes-sha1;ecp" (state=ST_AK)<br>
>>> [    aes-sha1;ecp_521] ERROR: Non alphanum char found after in modp<br>
>>> string, just after "aes-sha1;ecp" (state=ST_AK)<br>
>>><br>
>>> so things are at least consistent (and dh21 is the preferred name).<br>
>>> I'll tweak the parser.<br>
>><br>
>><br>
</div></div></blockquote></div><br></div>