aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/lib/libotputil/lrfc2289-otp.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libotputil/lrfc2289-otp.c')
-rw-r--r--lib/libotputil/lrfc2289-otp.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libotputil/lrfc2289-otp.c b/lib/libotputil/lrfc2289-otp.c
index d02343a..ba180bb 100644
--- a/lib/libotputil/lrfc2289-otp.c
+++ b/lib/libotputil/lrfc2289-otp.c
@@ -156,6 +156,7 @@ otputil_otp_str(
156 const char * otp_seed, 156 const char * otp_seed,
157 int otp_seq, 157 int otp_seq,
158 int otp_hash, 158 int otp_hash,
159 int otp_encoding,
159 char * dst, 160 char * dst,
160 size_t dstlen ) 161 size_t dstlen )
161{ 162{
@@ -166,6 +167,7 @@ otputil_otp_str(
166 167
167 dstlen = ((dst)) ? dstlen : sizeof(buff); 168 dstlen = ((dst)) ? dstlen : sizeof(buff);
168 dst = ((dst)) ? dst : buff; 169 dst = ((dst)) ? dst : buff;
170 otp_encoding = ((otp_encoding)) ? otp_encoding : otputil_defaults.otp_encoding;
169 res.bv_val = bv_val; 171 res.bv_val = bv_val;
170 res.bv_len = sizeof(bv_val); 172 res.bv_len = sizeof(bv_val);
171 173
@@ -180,7 +182,7 @@ otputil_otp_str(
180 bv_val[5] = (val >> 16) & 0xff; 182 bv_val[5] = (val >> 16) & 0xff;
181 bv_val[6] = (val >> 8) & 0xff; 183 bv_val[6] = (val >> 8) & 0xff;
182 bv_val[7] = (val >> 0) & 0xff; 184 bv_val[7] = (val >> 0) & 0xff;
183 otputil_otp_encode(&res, dst, dstlen, OTPUTIL_ENC_SIXWORD); 185 otputil_otp_encode(&res, dst, dstlen, otp_encoding);
184 186
185 return(dst); 187 return(dst);
186} 188}