You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2019/11/15 15:31:30 UTC

[GitHub] [mynewt-core] nkaje commented on a change in pull request #2094: oc_core: randomize uuid before use

nkaje commented on a change in pull request #2094: oc_core: randomize uuid before use
URL: https://github.com/apache/mynewt-core/pull/2094#discussion_r346878800
 
 

 ##########
 File path: net/oic/src/api/oc_core_res.c
 ##########
 @@ -236,6 +252,8 @@ oc_core_init_platform(const char *mfg_name, oc_core_init_platform_cb_t init_cb,
                                    core_resources[OCF_P].interfaces);
     oc_rep_set_uint(root, p, core_resources[OCF_P].properties & ~OC_PERIODIC);
 
+    /* Initialize with random values */
+    oc_core_randomize_uuid(&uuid);
     oc_gen_uuid(&uuid);
 
 Review comment:
   I looked into https://tools.ietf.org/html/rfc4122#page-14, as the oc_gen_uuid() is implementing type 4. This indicated that except from the 8th octet and 6th octet, others should be random.
   The warning from code coverage tool is due to uninitialized variable. To fix this warning and satisfy the RFC requirement, the values need to be initialized with random values. Hence the randomization.
   
   I can certainly move this call into oc_gen_uuid(). Let me know what you think.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services