1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01:00

* certreqgen.c (create_request): Store the email address in the req.

Note, that I have not yet achieved to generate a cert with the
subjectAltName using OpenSSL.  It seems that openssl requires the
email address to be part of the subject DN (subjectAltName=email:copy)
but this is something we don't want to do.
This commit is contained in:
Werner Koch 2002-01-28 14:23:18 +00:00
parent 8536088075
commit fc8d8e9987
2 changed files with 31 additions and 1 deletions

View File

@ -1,3 +1,7 @@
2002-01-28 Werner Koch <wk@gnupg.org>
* certreqgen.c (create_request): Store the email address in the req.
2002-01-25 Werner Koch <wk@gnupg.org>
* gpgsm.c (main): Disable core dumps.

View File

@ -494,6 +494,7 @@ create_request (struct para_data_s *para, KsbaConstSexp public,
GCRY_MD_HD md;
KsbaStopReason stopreason;
int rc = 0;
const char *s;
cr = ksba_certreq_new ();
if (!cr)
@ -512,7 +513,7 @@ create_request (struct para_data_s *para, KsbaConstSexp public,
ksba_certreq_set_hash_function (cr, HASH_FNC, md);
ksba_certreq_set_writer (cr, outctrl->writer);
err = ksba_certreq_set_subject (cr, get_parameter_value (para, pNAMEDN));
err = ksba_certreq_add_subject (cr, get_parameter_value (para, pNAMEDN));
if (err)
{
log_error ("error setting the subject's name: %s\n",
@ -521,6 +522,31 @@ create_request (struct para_data_s *para, KsbaConstSexp public,
goto leave;
}
s = get_parameter_value (para, pNAMEEMAIL);
if (s)
{
char *buf = xtrymalloc (strlen (s) + 3);
if (!buf)
{
rc = GNUPG_Out_Of_Core;
goto leave;
}
*buf = '<';
strcpy (buf+1, s);
strcat (buf+1, ">");
err = ksba_certreq_add_subject (cr, buf);
xfree (buf);
if (err)
{
log_error ("error setting the subject's alternate name: %s\n",
ksba_strerror (err));
rc = map_ksba_err (err);
goto leave;
}
}
err = ksba_certreq_set_public_key (cr, public);
if (err)
{