diff options
Diffstat (limited to 'imap')
-rw-r--r-- | imap/src/c-client/oauth2_aux.c | 10 | ||||
-rw-r--r-- | imap/src/osdep/nt/ssl_libressl.c | 2 | ||||
-rw-r--r-- | imap/src/osdep/unix/ssl_unix.c | 2 |
3 files changed, 7 insertions, 7 deletions
diff --git a/imap/src/c-client/oauth2_aux.c b/imap/src/c-client/oauth2_aux.c index d2ad6ce6..a0828ba4 100644 --- a/imap/src/c-client/oauth2_aux.c +++ b/imap/src/c-client/oauth2_aux.c @@ -34,19 +34,19 @@ char *oauth2_generate_state(void) rv[0] = '\0'; for(i = 0; i < 4; i++) - sprintf(rv + strlen(rv), "%x", (unsigned int) (random() % 256)); + sprintf(rv + strlen(rv), "%02x", (unsigned int) (random() % 256)); sprintf(rv + strlen(rv), "%c", '-'); for(i = 0; i < 2; i++) - sprintf(rv + strlen(rv), "%x", (unsigned int) (random() % 256)); + sprintf(rv + strlen(rv), "%02x", (unsigned int) (random() % 256)); sprintf(rv + strlen(rv), "%c", '-'); for(i = 0; i < 2; i++) - sprintf(rv + strlen(rv), "%x", (unsigned int) (random() % 256)); + sprintf(rv + strlen(rv), "%02x", (unsigned int) (random() % 256)); sprintf(rv + strlen(rv), "%c", '-'); for(i = 0; i < 2; i++) - sprintf(rv + strlen(rv), "%x", (unsigned int) (random() % 256)); + sprintf(rv + strlen(rv), "%02x", (unsigned int) (random() % 256)); sprintf(rv + strlen(rv), "%c", '-'); for(i = 0; i < 6; i++) - sprintf(rv + strlen(rv), "%x", (unsigned int) (random() % 256)); + sprintf(rv + strlen(rv), "%02x", (unsigned int) (random() % 256)); rv[36] = '\0'; return cpystr(rv); } diff --git a/imap/src/osdep/nt/ssl_libressl.c b/imap/src/osdep/nt/ssl_libressl.c index 04dfb36e..da466821 100644 --- a/imap/src/osdep/nt/ssl_libressl.c +++ b/imap/src/osdep/nt/ssl_libressl.c @@ -518,7 +518,7 @@ static char *ssl_validate_cert (X509 *cert,char *host) ret = "No name in certificate"; else if ((s = strstr (cert->name,"/CN=")) != NIL) { m++; /* count that we tried this method */ - if (t = strchr (s += 4,'/')) *t = '\0'; + if ((t = strchr (s += 4,'/')) != NIL) *t = '\0'; /* host name matches pattern? */ ret = ssl_compare_hostnames (host,s) ? NIL : "Server name does not match certificate"; diff --git a/imap/src/osdep/unix/ssl_unix.c b/imap/src/osdep/unix/ssl_unix.c index e9243769..601888ec 100644 --- a/imap/src/osdep/unix/ssl_unix.c +++ b/imap/src/osdep/unix/ssl_unix.c @@ -535,7 +535,7 @@ static char *ssl_validate_cert (X509 *cert,char *host) ret = "No name in certificate"; else if ((s = strstr (cert->name,"/CN=")) != NIL) { m++; /* count that we tried this method */ - if (t = strchr (s += 4,'/')) *t = '\0'; + if ((t = strchr (s += 4,'/')) != NIL) *t = '\0'; /* host name matches pattern? */ ret = ssl_compare_hostnames (host,s) ? NIL : "Server name does not match certificate"; |