Full_Name: Peter Marschall
Submission from: (NULL) (184.108.40.206)
I have written some bugfixes & flexibilizations for the TOTP contrib module.
You can find them in the github branch:
It differs from today's master by these commits:
contrib/passwd/totp: flexibilize decoding key
In function totp_b32_pton()
- allow lowercase characters in encoded string too
This patch is incorrect. You must guard toupper(), it is not guaranteed not to
distort non-lowercase characters.
if (islower(x)) x = toupper(x)
- allow padding to be omitted (totally, not only parts)
In function chk_totp() determine the space required to hold the
key by calling totp_b32_pton() with a NULL argument for the target.
contrib/passwd/totp: fix the big-endian case
For the big-endian case, 'msg' wasn't set from 'tval' in
This patch is wrong, as I commented on github.
contrib/passwd/totp: fix decoding when padding is used
In totp_b32_pton(), correctly count the number of '=' padding chars
at the end of the base-32 encoded string.
Note: '*str++' evaluates *str first and increases str later!
The current code correctly decodes known test data. What is your test case?
The proper way to add this support is to add macros to hide all of the
differences in the initial ifdef block and not to add any additional ifdefs
anywhere in the main body of the code.
that change the file
contrib/slapd-modules/passwd/totp/slapd-totp.c | 67
I'd appreciate if you include them into OpenLDAP.
The referenced patch files are derived from OpenLDAP Software.
All of the modifications to OpenLDAP Software represented in the following
patch(es) were developedy y Peter Marschall <peter(a)adpm.de>.
I have not assigned rights and/or interest in this work to any party.
The referenced modifications to OpenLDAP Software are subject to the following
Copyright 2015 Peter Marschall
Redistribution and use in source and binary forms, with or without
are permitted only as authorized by the OpenLDAP Public License.
Thanks in advance
-- Howard Chu
CTO, Symas Corp. http://www.symas.com
Director, Highland Sun http://highlandsun.com/hyc/
Chief Architect, OpenLDAP http://www.openldap.org/project/