Changeset 678 in openpam for trunk/include


Ignore:
Timestamp:
Mar 18, 2013, 9:34:29 PM (8 years ago)
Author:
Dag-Erling Smørgrav
Message:

Set a reasonable, hard limit on label length. This removes the need for
a variable-length key structure (to accommodate a variable-length label)
and vastly simplifies key parsing.

Location:
trunk/include/security
Files:
3 edited

Legend:

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

    r677 r678  
    3737#include <security/oath_rfc4648.h>
    3838
    39 struct oath_key *oath_key_alloc(size_t);
     39struct oath_key *oath_key_alloc(void);
    4040void oath_key_free(struct oath_key *);
    4141struct oath_key *oath_key_from_uri(const char *);
  • trunk/include/security/oath_constants.h

    r655 r678  
    7272#define OATH_MAX_KEYLEN         64
    7373
     74/*
     75 * Maximum label length in characters, including terminating NUL.
     76 */
     77#define OATH_MAX_LABELLEN       64
     78
    7479#endif
  • trunk/include/security/oath_types.h

    r655 r678  
    4848        /* label */
    4949        size_t           labellen; /* bytes incl. NUL */
    50         char            *label;
     50        char             label[OATH_MAX_LABELLEN];
    5151
    5252        /* key */
    5353        size_t           keylen; /* bytes */
    54         uint8_t         *key;
    55 
    56         /* buffer for label + NUL + key */
    57         size_t           datalen; /* bytes */
    58         uint8_t          data[];
     54        uint8_t          key[OATH_MAX_KEYLEN];
    5955};
    6056
Note: See TracChangeset for help on using the changeset viewer.