~7-luca/skylable/master

« back to all changes in this revision

Viewing changes to libsxclient/src/nss.c

  • Committer: Alberto Wu
  • Date: 2015-10-29 16:39:50 UTC
  • Revision ID: git-v1:4d0837a887d92ed148e87a6e7bb7f4096046dc98
Allow building with valgrind hints (--enable-vghints)

Show diffs side-by-side

added added

removed removed

Lines of Context:
254
254
    sxi_info(sx, "NSS: %s", NSS_GetVersion());
255
255
}
256
256
 
257
 
int sxi_rand_bytes(unsigned char *d, int len)
 
257
int sxi_rand_bytes_impl(unsigned char *d, int len)
258
258
{
259
259
    /* TODO: does this block, use /dev/urandom instead? */
260
260
    if (PK11_GenerateRandom(d, len) == SECSuccess)
261
 
        return 1;
262
 
    return 0;
 
261
        return 0; /* Success */
 
262
    else
 
263
        return -1; /* Failure */
263
264
}
264
265
 
265
 
int sxi_rand_pseudo_bytes(unsigned char *d, int len)
 
266
int sxi_rand_pseudo_bytes_impl(unsigned char *d, int len)
266
267
{
267
 
    return sxi_rand_bytes(d, len);
 
268
    return sxi_rand_bytes_impl(d, len);
268
269
}
269
270
 
270
271
void sxi_rand_cleanup(void)