From 2744df4f7a1854a9f1fc7b85587df7a4fd4cf8e0 Mon Sep 17 00:00:00 2001 From: Jonathan Leroy Date: Sat, 10 Oct 2015 21:58:07 +0200 Subject: [PATCH] cert_write : fix "Destination buffer is too small" error This commit fixes the `Destination buffer is too small` error returned by `mbedtls_cert_write` command when the values of `subject_name` or `issuer_name` parameters exceed 128 characters. I have increased the size of these varaibles from 128 to 256 characters, but I don't know if it's the best way to solve this issue... Fixes #315. --- programs/x509/cert_write.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/programs/x509/cert_write.c b/programs/x509/cert_write.c index 5010193d2..57cb6c7c0 100644 --- a/programs/x509/cert_write.c +++ b/programs/x509/cert_write.c @@ -190,11 +190,11 @@ int main( int argc, char *argv[] ) pk_context *issuer_key = &loaded_issuer_key, *subject_key = &loaded_subject_key; char buf[1024]; - char issuer_name[128]; + char issuer_name[256]; int i; char *p, *q, *r; #if defined(POLARSSL_X509_CSR_PARSE_C) - char subject_name[128]; + char subject_name[256]; x509_csr csr; #endif x509write_cert crt;