mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
dirmngr: Fix LDAP time parser.
* dirmngr/ldap-misc.c (rfc4517toisotime): Correct index. -- Obviously the parser assumes the standard ISO format with the 'T' before the hour. That is not correct here. We need this parser for the modifyTimestamp thingy.
This commit is contained in:
parent
fa29c86582
commit
32c55603df
1 changed files with 2 additions and 1 deletions
|
@ -380,13 +380,14 @@ rfc4517toisotime (gnupg_isotime_t timebuf, const char *string)
|
||||||
int year, month, day, hour, minu, sec;
|
int year, month, day, hour, minu, sec;
|
||||||
const char *s;
|
const char *s;
|
||||||
|
|
||||||
|
/* Sample value: "20230823141623Z"; */
|
||||||
for (i=0, s=string; i < 10; i++, s++) /* Need yyyymmddhh */
|
for (i=0, s=string; i < 10; i++, s++) /* Need yyyymmddhh */
|
||||||
if (!digitp (s))
|
if (!digitp (s))
|
||||||
return gpg_error (GPG_ERR_INV_TIME);
|
return gpg_error (GPG_ERR_INV_TIME);
|
||||||
year = atoi_4 (string);
|
year = atoi_4 (string);
|
||||||
month = atoi_2 (string + 4);
|
month = atoi_2 (string + 4);
|
||||||
day = atoi_2 (string + 6);
|
day = atoi_2 (string + 6);
|
||||||
hour = atoi_2 (string + 9);
|
hour = atoi_2 (string + 8);
|
||||||
minu = 0;
|
minu = 0;
|
||||||
sec = 0;
|
sec = 0;
|
||||||
if (digitp (s) && digitp (s+1))
|
if (digitp (s) && digitp (s+1))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue