Changeset 772 in openpam


Ignore:
Timestamp:
Mar 9, 2014, 11:45:05 AM (7 years ago)
Author:
Dag-Erling Smørgrav
Message:

Switch from uint8_t to char.

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/security/oath_rfc4648.h

    r655 r772  
    3838
    3939/* base32 encoding / decoding */
    40 int base32_enc(const uint8_t *, size_t, char *, size_t *);
    41 int base32_dec(const char *, size_t, uint8_t *, size_t *);
     40int base32_enc(const char *, size_t, char *, size_t *);
     41int base32_dec(const char *, size_t, char *, size_t *);
    4242
    4343/* estimate of output length for base64 encoding / decoding */
     
    4646
    4747/* base64 encoding / decoding */
    48 int base64_enc(const uint8_t *, size_t, char *, size_t *);
    49 int base64_dec(const char *, size_t, uint8_t *, size_t *);
     48int base64_enc(const char *, size_t, char *, size_t *);
     49int base64_dec(const char *, size_t, char *, size_t *);
    5050
    5151#endif
  • trunk/lib/liboath/oath_base32.c

    r771 r772  
    4545    "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";
    4646
    47 static const uint8_t b32dec[256] = {
     47static const char b32dec[256] = {
    4848        ['A'] =  0, ['B'] =  1, ['C'] =  2, ['D'] =  3,
    4949        ['E'] =  4, ['F'] =  5, ['G'] =  6, ['H'] =  7,
     
    7171 */
    7272int
    73 base32_enc(const uint8_t *in, size_t ilen, char *out, size_t *olen)
     73base32_enc(const char *in, size_t ilen, char *out, size_t *olen)
    7474{
    7575        uint64_t bits;
     
    144144 */
    145145int
    146 base32_dec(const char *in, size_t ilen, uint8_t *out, size_t *olen)
     146base32_dec(const char *in, size_t ilen, char *out, size_t *olen)
    147147{
    148148        size_t len;
  • trunk/lib/liboath/oath_base64.c

    r771 r772  
    4646    "0123456789+/";
    4747
    48 static const uint8_t b64dec[256] = {
     48static const char b64dec[256] = {
    4949        ['A'] =  0, ['B'] =  1, ['C'] =  2, ['D'] =  3,
    5050        ['E'] =  4, ['F'] =  5, ['G'] =  6, ['H'] =  7,
     
    7070 */
    7171int
    72 base64_enc(const uint8_t *in, size_t ilen, char *out, size_t *olen)
     72base64_enc(const char *in, size_t ilen, char *out, size_t *olen)
    7373{
    7474        uint32_t bits;
     
    127127 */
    128128int
    129 base64_dec(const char *in, size_t ilen, uint8_t *out, size_t *olen)
     129base64_dec(const char *in, size_t ilen, char *out, size_t *olen)
    130130{
    131131        size_t len;
  • trunk/lib/liboath/oath_key.c

    r758 r772  
    117117        }
    118118        uri = tmp;
    119         if (base32_enc(key->key, key->keylen, uri + urilen, &kslen) != 0) {
     119        if (base32_enc((char *)key->key, key->keylen, uri + urilen, &kslen) != 0) {
    120120                free(uri);
    121121                return (NULL);
  • trunk/lib/liboath/oath_key_from_uri.c

    r758 r772  
    108108                                goto invalid;
    109109                        key->keylen = sizeof key->key;
    110                         if (base32_dec(q, r - q, key->key, &key->keylen) != 0)
     110                        if (base32_dec(q, r - q, (char *)key->key, &key->keylen) != 0)
    111111                                goto invalid;
    112112                        if (base32_enclen(key->keylen) != (size_t)(r - q))
  • trunk/t/t_rfc4648.c

    r769 r772  
    9696static int
    9797t_rfc4648_enc(const char *plain, const char *encoded,
    98     int (*enc)(const uint8_t *, size_t, char *, size_t *))
     98    int (*enc)(const char *, size_t, char *, size_t *))
    9999{
    100100        char buf[64];
     
    104104        ilen = strlen(plain);
    105105        olen = strlen(encoded) + 1;
    106         if (enc((const uint8_t *)plain, ilen, buf, &blen) != 0) {
     106        if (enc((const char *)plain, ilen, buf, &blen) != 0) {
    107107                t_verbose("encoding failed\n");
    108108                return (0);
     
    147147static int
    148148t_rfc4648_dec(const char *encoded, const char *plain,
    149     int (*dec)(const char *, size_t, uint8_t *, size_t *))
     149    int (*dec)(const char *, size_t, char *, size_t *))
    150150{
    151151        char buf[64];
     
    155155        ilen = strlen(encoded);
    156156        olen = strlen(plain);
    157         if (dec(encoded, ilen, (uint8_t *)buf, &blen) != 0) {
     157        if (dec(encoded, ilen, buf, &blen) != 0) {
    158158                t_verbose("encoding failed\n");
    159159                return (0);
Note: See TracChangeset for help on using the changeset viewer.