Update ip_string_to_bytes to cert_req version

Signed-off-by: Andrzej Kurek <[email protected]>
This commit is contained in:
Andrzej Kurek
2023-05-17 15:23:56 -04:00
parent a194904055
commit ed557930bb
+2 -3
View File
@@ -216,17 +216,16 @@ struct options {
int format; /* format */
} opt;
static int ip_string_to_bytes(const char *str, uint8_t *bytes, int maxBytes)
static void ip_string_to_bytes(const char *str, uint8_t *bytes, int maxBytes)
{
for (int i = 0; i < maxBytes; i++) {
bytes[i] = strtoul(str, NULL, 16);
bytes[i] = (uint8_t) strtoul(str, NULL, 16);
str = strchr(str, '.');
if (str == NULL || *str == '\0') {
break;
}
str++;
}
return 0;
}
int write_certificate(mbedtls_x509write_cert *crt, const char *output_file,