From 3e3be4c00dab346b2728c350238e8d0126729c73 Mon Sep 17 00:00:00 2001 From: Klas Lindfors Date: Thu, 9 Jan 2014 08:39:10 +0100 Subject: [PATCH] make ykp_get_supported_key_length() exported --- configure.ac | 8 ++++---- libykpers-1.map | 7 +++++++ ykpers.c | 6 +++--- ykpers.h | 2 ++ 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/configure.ac b/configure.ac index 30a2280..fb3158b 100644 --- a/configure.ac +++ b/configure.ac @@ -26,7 +26,7 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -AC_INIT([yubikey-personalization], [1.14.3], +AC_INIT([yubikey-personalization], [1.15.0], [yubico-devel@googlegroups.com], [ykpers], [http://opensource.yubico.com/yubikey-personalization/]) AC_CONFIG_AUX_DIR([build-aux]) @@ -36,9 +36,9 @@ AC_CONFIG_MACRO_DIR([m4]) # Interfaces changed/added/removed: CURRENT++ REVISION=0 # Interfaces added: AGE++ # Interfaces removed: AGE=0 -AC_SUBST(LT_CURRENT, 15) -AC_SUBST(LT_REVISION, 1) -AC_SUBST(LT_AGE, 14) +AC_SUBST(LT_CURRENT, 16) +AC_SUBST(LT_REVISION, 0) +AC_SUBST(LT_AGE, 15) AM_INIT_AUTOMAKE([1.11.3 -Wall -Werror]) AM_SILENT_RULES([yes]) diff --git a/libykpers-1.map b/libykpers-1.map index ac36839..d92dbb8 100644 --- a/libykpers-1.map +++ b/libykpers-1.map @@ -242,3 +242,10 @@ LIBYKPERS_1.14 { ykp_get_acccode_type; # Variables: } LIBYKPERS_1.13; + +LIBYKPERS_1.15 { + global: +# Functions: + ykp_get_supported_key_length; +# Variables: +} LIBYKPERS_1.14; diff --git a/ykpers.c b/ykpers.c index 57d5bf5..da24f37 100644 --- a/ykpers.c +++ b/ykpers.c @@ -231,7 +231,7 @@ int ykp_configure_for(YKP_CONFIG *cfg, int confnum, YK_STATUS *st) /* Return number of bytes of key data for this configuration. * 20 bytes is 160 bits, 16 bytes is 128. */ -static int _get_supported_key_length(const YKP_CONFIG *cfg) +int ykp_get_supported_key_length(const YKP_CONFIG *cfg) { /* OATH-HOTP and HMAC-SHA1 challenge response support 20 byte (160 bits) * keys, holding the last four bytes in the uid field. @@ -319,7 +319,7 @@ int ykp_AES_key_from_passphrase(YKP_CONFIG *cfg, const char *passphrase, size_t _salt_len = 0; unsigned char buf[sizeof(cfg->ykcore_config.key) + 4]; int rc; - int key_bytes = _get_supported_key_length(cfg); + int key_bytes = ykp_get_supported_key_length(cfg); YK_PRF_METHOD prf_method = {20, yk_hmac_sha1}; assert (key_bytes <= sizeof(buf)); @@ -920,7 +920,7 @@ static int _ykp_legacy_export_config(const YKP_CONFIG *cfg, char *buf, size_t le /* for OATH-HOTP and HMAC-SHA1 challenge response, there is four bytes * additional key data in the uid field */ - key_bits_in_uid = (_get_supported_key_length(cfg) == 20); + key_bits_in_uid = (ykp_get_supported_key_length(cfg) == 20); /* fixed: or OATH id: */ if ((ycfg.tktFlags & TKTFLAG_OATH_HOTP) == TKTFLAG_OATH_HOTP && diff --git a/ykpers.h b/ykpers.h index 94fdf7d..95d6822 100644 --- a/ykpers.h +++ b/ykpers.h @@ -190,6 +190,8 @@ unsigned int ykp_get_acccode_type(const YKP_CONFIG *cfg); #define YKP_ACCCODE_RANDOM 0x02 #define YKP_ACCCODE_SERIAL 0x03 +int ykp_get_supported_key_length(const YKP_CONFIG *cfg); + extern int * _ykp_errno_location(void); #define ykp_errno (*_ykp_errno_location()) const char *ykp_strerror(int errnum); -- 2.39.5