X-Git-Url: http://www.average.org/gitweb/?p=pam_pcsc_cr.git;a=blobdiff_plain;f=authfile.c;h=93157a4e1a9a8460c46a6fc609e1b18a62fd5885;hp=89d32438383d935b08fa85ee18c784a740c55695;hb=HEAD;hpb=ab1ccc1f4ceb5786bd722d3a66e870a67972b505 diff --git a/authfile.c b/authfile.c index 89d3243..17354b8 100644 --- a/authfile.c +++ b/authfile.c @@ -108,11 +108,11 @@ int parse(char * const buf, const int argc, const char *argv[const]) } struct _auth_obj authfile(const char *userid, const char *password, - void (*update_nonce)(char *nonce, const int nonsize), - const unsigned char *secret, const int secsize, - const unsigned char *payload, const int paylsize, + void (*update_nonce)(char *nonce, const size_t nonsize), + const unsigned char *secret, const size_t secsize, + const unsigned char *payload, const size_t paylsize, struct _auth_chunk (*fetch_key)(const unsigned char *chal, - const int csize)) + const size_t csize)) { struct _auth_obj ret = {0}; const struct passwd *pw = NULL; @@ -190,7 +190,7 @@ struct _auth_obj authfile(const char *userid, const char *password, oldmask = umask(077); if ((fp = fopen(nfn, "w"))) { - int bsize = ((ao.datasize-1)/3+1)*4+2; /* why +2 ??? */ + int bsize = ((ao.datasize-1)/3+1)*4+1; char *b64 = alloca(bsize); if (b64_encode(ao.data, ao.datasize, b64, &bsize)) { @@ -200,7 +200,7 @@ struct _auth_obj authfile(const char *userid, const char *password, ret.err = strerror(errno); } if (st.st_uid || st.st_gid) { - if (fchown(fileno(fp), st.st_uid, st.st_gid)) /*ign*/; + if (fchown(fileno(fp), st.st_uid, st.st_gid)) {/*ign*/;} } if (fclose(fp) < 0) { ret.err = strerror(errno);