I'm adding Bruce into CC. Most likely using the O_BINARY flag should
solve that. Jorg could you try if the attached patch address the
issue?
On Sun, Nov 15, 2015 at 2:39 PM, Jörg Weinhardt <[email protected]> wrote:
> Am 15.11.2015 um 09:55 schrieb Nikos Mavrogiannopoulos:
>> On Fri, 2015-11-13 at 17:28 +0100, Jörg Weinhardt wrote:
>>> Hi,
>>>
>>> I tried to use certtool from GnuTLS 3.4.5-w32 and also GnuTLS
>>> 3.3.13-w32 using a template file as input.
>>>
>>> I always get the following error message:
>>>
>>> certtool -V --generate-self-signed --load-privkey test_key.key
>>> --template test_template.txt --outfile test_cert.cert
>>> libopts error 0 (No error) calling read for 'test_template.txt'
>>> configFileLoad: No error
>>> Error loading template: test_template.txt
>>
>> Hi,
>> That is output by libopts used by certtool to read the template. It
>> seems that libopts gets a premature end of file while reading it.
>> However, I couldn't reproduce that with wine and your configuration
>> file. Which version of windows is that?
>>
>>
>> regards,
>> Nikos
>>
>>
>
>
> Hi Nikos,
>
> that was a good hint! I replaced the Windows CR/LF by a Unix-style LF
> and it works. Is it possible to configure libopts to handle both?
>
> Thanks and regards,
> Joerg
diff --git a/src/libopts/text_mmap.c b/src/libopts/text_mmap.c
index f30e71c..ca6b7ee 100644
--- a/src/libopts/text_mmap.c
+++ b/src/libopts/text_mmap.c
@@ -194,6 +194,10 @@ validate_mmap(char const * fname, int prot, int flags, tmap_info_t * mapinfo)
if (((flags & MAP_SHARED) == 0) && (prot & PROT_WRITE))
o_flag |= O_EXCL;
+#ifdef _WIN32
+ o_flag |= O_BINARY;
+#endif
+
mapinfo->txt_fd = open(fname, o_flag);
if (mapinfo->txt_fd < 0) {
mapinfo->txt_errno = errno;
_______________________________________________
Gnutls-help mailing list
[email protected]
http://lists.gnupg.org/mailman/listinfo/gnutls-help