*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*
* Copyright 2005,2006 TRI-D Systems, Inc.
*/
* Returns keylen on success, -1 otherwise.
*/
static int
-cryptocard_keystring2keyblock(const char *keystring,
- unsigned char keyblock[OTP_MAX_KEY_LEN])
+cryptocard_keystring2keyblock(otp_card_info_t *card_info)
{
/* 64-bit DES key with optional line ending */
- if ((strlen(keystring) & ~1) != 16)
+ if ((strlen(card_info->keystring) & ~1) != 16)
return 1;
- return otp_keystring2keyblock(keystring, keyblock);
+ return otp_keystring2keyblock(card_info->keystring, card_info->keyblock);
}
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*
* Copyright 2005,2006 TRI-D Systems, Inc.
*/
#define CRYPTOCARD_DP_RS (CRYPTOCARD_DP_RC|CRYPTOCARD_DP_ES)
static int cryptocard_name2fm(const char *, uint32_t *);
-static int cryptocard_keystring2keyblock(const char *,
- unsigned char [OTP_MAX_KEY_LEN]);
+static int cryptocard_keystring2keyblock(otp_card_info_t *);
static int cryptocard_nullstate(const otp_option_t *, const otp_card_info_t *,
otp_user_state_t *, time_t, const char *);
static int cryptocard_challenge(const otp_card_info_t *, otp_user_state_t *,
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*
*
* Copyright 2002-2005 Google, Inc.
}
/* Convert keystring to a keyblock. */
- if (card_info.cardops->keystring2keyblock(card_info.keystring,
- card_info.keyblock) < 0) {
+ if (card_info.cardops->keystring2keyblock(&card_info) < 0) {
otp_log(OTP_LOG_ERR, "%s: %s: invalid key '%s' for [%s]",
log_prefix, __func__, card_info.keystring, username);
rc = OTP_RC_SERVICE_ERR;
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*
* Copyright 2005,2006 TRI-D Systems, Inc.
*/
size_t prefix_len; /* to avoid strlen(prefix) */
int (*name2fm)(const char *, uint32_t *);
- int (*keystring2keyblock)(const char *, unsigned char [OTP_MAX_KEY_LEN]);
+ int (*keystring2keyblock)(otp_card_info_t *);
int (*nullstate)(const otp_option_t *, const otp_card_info_t *,
otp_user_state_t *, time_t, const char *);
int (*challenge)(const otp_card_info_t *, otp_user_state_t *,