pike.git / src / post_modules / Nettle / nettle.cmod

version» Context lines:

pike.git/src/post_modules/Nettle/nettle.cmod:1:   /* nettle.cmod -*- c -*- */ - /* $Id: nettle.cmod,v 1.43 2007/12/20 19:03:46 nilsson Exp $ */ + /* $Id: nettle.cmod,v 1.44 2008/05/29 22:50:20 nilsson Exp $ */      #include "global.h"   #include "interpret.h"   #include "svalue.h"   /* For this_object() */   #include "object.h"   #include "operators.h"   #include "module_support.h"   #include "threads.h"   
pike.git/src/post_modules/Nettle/nettle.cmod:195:    yarrow256_random(&THIS->ctx, length, (uint8_t *)rnd->str);    RETURN end_shared_string(rnd);    }       INIT    {    THIS->sources = NULL;    yarrow256_init(&THIS->ctx, 0, NULL);    }    EXIT +  gc_trivial;    {    /* It's ok to call free(NULL); */    free(THIS->sources);    }   }      /*! @endclass    */      /*! @decl string crypt_md5(string password, string salt)
pike.git/src/post_modules/Nettle/nettle.cmod:315:       INIT    {    THIS->object = 0;    THIS->iv = 0;    THIS->block_size = 0;    THIS->mode = 0;    }       EXIT +  gc_trivial;    {    if(THIS->object) free_object(THIS->object);    if(THIS->iv) {    MEMSET(THIS->iv, 0, THIS->block_size);    free(THIS->iv);    }    THIS->iv = 0;    }       INLINE static void cbc_encrypt_step(const unsigned INT8 *const source,
pike.git/src/post_modules/Nettle/nettle.cmod:536:    CVAR unsigned char *backlog;    CVAR int backlog_len;       INIT {    THIS->object = 0;    THIS->block_size = 0;    THIS->backlog = 0;    THIS->backlog_len = 0;    }    -  EXIT { +  EXIT +  gc_trivial; +  {    if(THIS->backlog) {    MEMSET(THIS->backlog, 0, THIS->block_size);    free(THIS->backlog);    }    if(THIS->object)    free_object(THIS->object);    }       /*! @decl void create(program|object|function cipher, mixed ... args)    *! Initialize the Proxy wrapper with a cipher algorithm. If it is a
pike.git/src/post_modules/Nettle/nettle.cmod:802:    * @[Crypto.Yarrow] instead.    */   PIKECLASS LFib   {    CVAR struct knuth_lfib_ctx *ctx;       INIT {    THIS->ctx = xalloc(sizeof(struct knuth_lfib_ctx));    }    -  EXIT { +  EXIT +  gc_trivial; +  {    free(THIS->ctx);    }       /* @decl void create(int seed)    * The Lfib generator must be seeded with a number.    */    PIKEFUN void create(int seed)    flags ID_STATIC;    {    knuth_lfib_init(THIS->ctx, seed);