You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@axis.apache.org by "Nabeel Yoosuf (JIRA)" <ji...@apache.org> on 2006/11/08 06:24:50 UTC

[jira] Created: (AXIS2C-397) Rampart Utils - Some Code Improvements

Rampart Utils - Some Code Improvements
--------------------------------------

                 Key: AXIS2C-397
                 URL: http://issues.apache.org/jira/browse/AXIS2C-397
             Project: Axis2-C
          Issue Type: Improvement
          Components: rampart
    Affects Versions: Current (Nightly)
         Environment: All
            Reporter: Nabeel Yoosuf
            Priority: Minor


I had a quick glance at some of the files in rampart utils..Some suggestions

1. In some functions the same value is recalculated several times which is not efficient.
E.g.
rampart_utils.c:rampart_generate_nonce(..)
OXS_BUFFER_GET_SIZE(buffer, env)

rampart_cryto_utils.c:rampart_crypto_sha1(..)
axis2_base64_decode_len(nonce)

2. Memory leaks
E.g.
rampart_crypt_utils.c:45 - what is allocated is not freed

3. I find many printf's - are these for debugging? the better way is to perform a runtime debugging.

Thanks
-Nabeel

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org


[jira] Resolved: (AXIS2C-397) Rampart Utils - Some Code Improvements

Posted by "Malinda Kaushalye Kapuruge (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS2C-397?page=all ]

Malinda Kaushalye Kapuruge resolved AXIS2C-397.
-----------------------------------------------

    Fix Version/s: Current (Nightly)
                       (was: 0.96)
       Resolution: Fixed

Removed printfs and fixed memory leaks. 

> Rampart Utils - Some Code Improvements
> --------------------------------------
>
>                 Key: AXIS2C-397
>                 URL: http://issues.apache.org/jira/browse/AXIS2C-397
>             Project: Axis2-C
>          Issue Type: Improvement
>          Components: rampart
>    Affects Versions: Current (Nightly)
>         Environment: All
>            Reporter: Nabeel Yoosuf
>         Assigned To: Malinda Kaushalye Kapuruge
>            Priority: Minor
>             Fix For: Current (Nightly)
>
>
> I had a quick glance at some of the files in rampart utils..Some suggestions
> 1. In some functions the same value is recalculated several times which is not efficient.
> E.g.
> rampart_utils.c:rampart_generate_nonce(..)
> OXS_BUFFER_GET_SIZE(buffer, env)
> rampart_cryto_utils.c:rampart_crypto_sha1(..)
> axis2_base64_decode_len(nonce)
> 2. Memory leaks
> E.g.
> rampart_crypt_utils.c:45 - what is allocated is not freed
> 3. I find many printf's - are these for debugging? the better way is to perform a runtime debugging.
> Thanks
> -Nabeel

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org


[jira] Assigned: (AXIS2C-397) Rampart Utils - Some Code Improvements

Posted by "Malinda Kaushalye Kapuruge (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS2C-397?page=all ]

Malinda Kaushalye Kapuruge reassigned AXIS2C-397:
-------------------------------------------------

    Assignee: Malinda Kaushalye Kapuruge

> Rampart Utils - Some Code Improvements
> --------------------------------------
>
>                 Key: AXIS2C-397
>                 URL: http://issues.apache.org/jira/browse/AXIS2C-397
>             Project: Axis2-C
>          Issue Type: Improvement
>          Components: rampart
>    Affects Versions: Current (Nightly)
>         Environment: All
>            Reporter: Nabeel Yoosuf
>         Assigned To: Malinda Kaushalye Kapuruge
>            Priority: Minor
>
> I had a quick glance at some of the files in rampart utils..Some suggestions
> 1. In some functions the same value is recalculated several times which is not efficient.
> E.g.
> rampart_utils.c:rampart_generate_nonce(..)
> OXS_BUFFER_GET_SIZE(buffer, env)
> rampart_cryto_utils.c:rampart_crypto_sha1(..)
> axis2_base64_decode_len(nonce)
> 2. Memory leaks
> E.g.
> rampart_crypt_utils.c:45 - what is allocated is not freed
> 3. I find many printf's - are these for debugging? the better way is to perform a runtime debugging.
> Thanks
> -Nabeel

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org


[jira] Closed: (AXIS2C-397) Rampart Utils - Some Code Improvements

Posted by "Malinda Kaushalye Kapuruge (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2C-397?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Malinda Kaushalye Kapuruge closed AXIS2C-397.
---------------------------------------------


Closing issue

> Rampart Utils - Some Code Improvements
> --------------------------------------
>
>                 Key: AXIS2C-397
>                 URL: https://issues.apache.org/jira/browse/AXIS2C-397
>             Project: Axis2-C
>          Issue Type: Improvement
>          Components: rampart
>    Affects Versions: Current (Nightly)
>         Environment: All
>            Reporter: Nabeel Yoosuf
>         Assigned To: Malinda Kaushalye Kapuruge
>            Priority: Minor
>             Fix For: Current (Nightly)
>
>
> I had a quick glance at some of the files in rampart utils..Some suggestions
> 1. In some functions the same value is recalculated several times which is not efficient.
> E.g.
> rampart_utils.c:rampart_generate_nonce(..)
> OXS_BUFFER_GET_SIZE(buffer, env)
> rampart_cryto_utils.c:rampart_crypto_sha1(..)
> axis2_base64_decode_len(nonce)
> 2. Memory leaks
> E.g.
> rampart_crypt_utils.c:45 - what is allocated is not freed
> 3. I find many printf's - are these for debugging? the better way is to perform a runtime debugging.
> Thanks
> -Nabeel

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org


[jira] Updated: (AXIS2C-397) Rampart Utils - Some Code Improvements

Posted by "Samisa Abeysinghe (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS2C-397?page=all ]

Samisa Abeysinghe updated AXIS2C-397:
-------------------------------------

    Fix Version/s: 0.96

> Rampart Utils - Some Code Improvements
> --------------------------------------
>
>                 Key: AXIS2C-397
>                 URL: http://issues.apache.org/jira/browse/AXIS2C-397
>             Project: Axis2-C
>          Issue Type: Improvement
>          Components: rampart
>    Affects Versions: Current (Nightly)
>         Environment: All
>            Reporter: Nabeel Yoosuf
>         Assigned To: Malinda Kaushalye Kapuruge
>            Priority: Minor
>             Fix For: 0.96
>
>
> I had a quick glance at some of the files in rampart utils..Some suggestions
> 1. In some functions the same value is recalculated several times which is not efficient.
> E.g.
> rampart_utils.c:rampart_generate_nonce(..)
> OXS_BUFFER_GET_SIZE(buffer, env)
> rampart_cryto_utils.c:rampart_crypto_sha1(..)
> axis2_base64_decode_len(nonce)
> 2. Memory leaks
> E.g.
> rampart_crypt_utils.c:45 - what is allocated is not freed
> 3. I find many printf's - are these for debugging? the better way is to perform a runtime debugging.
> Thanks
> -Nabeel

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org


[jira] Commented: (AXIS2C-397) Rampart Utils - Some Code Improvements

Posted by "Nabeel Yoosuf (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/AXIS2C-397?page=comments#action_12448985 ] 
            
Nabeel Yoosuf commented on AXIS2C-397:
--------------------------------------

One more comment:
I notice that utility functions such as string functions are by-passed to use string.h functions in some code blocks. This may create platform dependent issues. It'd be advisable to use the functions defined in axis2_util.

Examples:
/*use axis2_strdup instead of strdup*/
src/omxmlsec/key.c:    oxs_key_impl->data = (unsigned char *)strdup(data);
src/omxmlsec/utility.c:    id = (axis2_char_t*)strdup(_id);

/*use axis2_strlen instead of strlen*/
src/omxmlsec/openssl/rsa.c:    ret = RSA_public_encrypt(strlen((char*)in),..
test/openssl/block_cipher_test.c:            in->data, strlen((char*)in->data), &out_main_buf, OPENSSL_ENCRYPT);

One more observation, but not directly related to Rampart, the utility functions such as axis2_strdup, axis2_strlen, really don't need macros..It'd be a lot cleaner if we remove them..just my $0.02 :) (This is related to on going thread http://marc.theaimsgroup.com/?l=axis-c-dev&m=116320443019844&w=2)

HTH 
-Nabeel


> Rampart Utils - Some Code Improvements
> --------------------------------------
>
>                 Key: AXIS2C-397
>                 URL: http://issues.apache.org/jira/browse/AXIS2C-397
>             Project: Axis2-C
>          Issue Type: Improvement
>          Components: rampart
>    Affects Versions: Current (Nightly)
>         Environment: All
>            Reporter: Nabeel Yoosuf
>         Assigned To: Malinda Kaushalye Kapuruge
>            Priority: Minor
>
> I had a quick glance at some of the files in rampart utils..Some suggestions
> 1. In some functions the same value is recalculated several times which is not efficient.
> E.g.
> rampart_utils.c:rampart_generate_nonce(..)
> OXS_BUFFER_GET_SIZE(buffer, env)
> rampart_cryto_utils.c:rampart_crypto_sha1(..)
> axis2_base64_decode_len(nonce)
> 2. Memory leaks
> E.g.
> rampart_crypt_utils.c:45 - what is allocated is not freed
> 3. I find many printf's - are these for debugging? the better way is to perform a runtime debugging.
> Thanks
> -Nabeel

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org


[jira] Commented: (AXIS2C-397) Rampart Utils - Some Code Improvements

Posted by "Malinda Kaushalye Kapuruge (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/AXIS2C-397?page=comments#action_12448058 ] 
            
Malinda Kaushalye Kapuruge commented on AXIS2C-397:
---------------------------------------------------

Thanks for pointing this out.
1. I have comitted a code that I used to debug :) Anyway I'll rectify it asap.
2 & 3.  This code is not in use for UsernameToken and Timestamp functionalities. I'm using this for debugigng the encryption. 

> Rampart Utils - Some Code Improvements
> --------------------------------------
>
>                 Key: AXIS2C-397
>                 URL: http://issues.apache.org/jira/browse/AXIS2C-397
>             Project: Axis2-C
>          Issue Type: Improvement
>          Components: rampart
>    Affects Versions: Current (Nightly)
>         Environment: All
>            Reporter: Nabeel Yoosuf
>         Assigned To: Malinda Kaushalye Kapuruge
>            Priority: Minor
>
> I had a quick glance at some of the files in rampart utils..Some suggestions
> 1. In some functions the same value is recalculated several times which is not efficient.
> E.g.
> rampart_utils.c:rampart_generate_nonce(..)
> OXS_BUFFER_GET_SIZE(buffer, env)
> rampart_cryto_utils.c:rampart_crypto_sha1(..)
> axis2_base64_decode_len(nonce)
> 2. Memory leaks
> E.g.
> rampart_crypt_utils.c:45 - what is allocated is not freed
> 3. I find many printf's - are these for debugging? the better way is to perform a runtime debugging.
> Thanks
> -Nabeel

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org