diff options
-rw-r--r-- | src/app.c | 9 | ||||
-rw-r--r-- | src/gmcerts.c | 6 | ||||
-rw-r--r-- | src/gmcerts.h | 3 | ||||
-rw-r--r-- | src/ui/util.c | 8 |
4 files changed, 16 insertions, 10 deletions
@@ -570,6 +570,7 @@ static iBool handleIdentityCreationCommands_(iWidget *dlg, const char *cmd) { | |||
570 | if (equal_Command(cmd, "ident.accept")) { | 570 | if (equal_Command(cmd, "ident.accept")) { |
571 | const iString *commonName = text_InputWidget (findChild_Widget(dlg, "ident.common")); | 571 | const iString *commonName = text_InputWidget (findChild_Widget(dlg, "ident.common")); |
572 | const iString *userId = text_InputWidget (findChild_Widget(dlg, "ident.userid")); | 572 | const iString *userId = text_InputWidget (findChild_Widget(dlg, "ident.userid")); |
573 | const iString *domain = text_InputWidget (findChild_Widget(dlg, "ident.domain")); | ||
573 | const iString *organization = text_InputWidget (findChild_Widget(dlg, "ident.org")); | 574 | const iString *organization = text_InputWidget (findChild_Widget(dlg, "ident.org")); |
574 | const iString *country = text_InputWidget (findChild_Widget(dlg, "ident.country")); | 575 | const iString *country = text_InputWidget (findChild_Widget(dlg, "ident.country")); |
575 | const iBool isTemp = isSelected_Widget(findChild_Widget(dlg, "ident.temp")); | 576 | const iBool isTemp = isSelected_Widget(findChild_Widget(dlg, "ident.temp")); |
@@ -591,9 +592,9 @@ static iBool handleIdentityCreationCommands_(iWidget *dlg, const char *cmd) { | |||
591 | if (n <= 0 || val[0] < (unsigned) today.year) { | 592 | if (n <= 0 || val[0] < (unsigned) today.year) { |
592 | makeMessage_Widget(orange_ColorEscape "INVALID DATE", | 593 | makeMessage_Widget(orange_ColorEscape "INVALID DATE", |
593 | "Please check the \"Valid until\" date. Examples:\n" | 594 | "Please check the \"Valid until\" date. Examples:\n" |
594 | "2030\n" | 595 | "\u2022 2030\n" |
595 | "2025-06-30\n" | 596 | "\u2022 2025-06-30\n" |
596 | "2021-12-31 23:59:59"); | 597 | "\u2022 2021-12-31 23:59:59"); |
597 | return iTrue; | 598 | return iTrue; |
598 | } | 599 | } |
599 | until.year = val[0]; | 600 | until.year = val[0]; |
@@ -615,7 +616,7 @@ static iBool handleIdentityCreationCommands_(iWidget *dlg, const char *cmd) { | |||
615 | } | 616 | } |
616 | /* The input seems fine. */ | 617 | /* The input seems fine. */ |
617 | newIdentity_GmCerts(d->certs, isTemp ? temporary_GmIdentityFlag : 0, | 618 | newIdentity_GmCerts(d->certs, isTemp ? temporary_GmIdentityFlag : 0, |
618 | until, commonName, userId, organization, country); | 619 | until, commonName, userId, domain, organization, country); |
619 | postCommandf_App("sidebar.mode arg:%d show:1", identities_SidebarMode); | 620 | postCommandf_App("sidebar.mode arg:%d show:1", identities_SidebarMode); |
620 | postCommand_App("idents.changed"); | 621 | postCommand_App("idents.changed"); |
621 | } | 622 | } |
diff --git a/src/gmcerts.c b/src/gmcerts.c index cffa744f..923987b1 100644 --- a/src/gmcerts.c +++ b/src/gmcerts.c | |||
@@ -404,12 +404,14 @@ const iGmIdentity *identityForUrl_GmCerts(const iGmCerts *d, const iString *url) | |||
404 | } | 404 | } |
405 | 405 | ||
406 | iGmIdentity *newIdentity_GmCerts(iGmCerts *d, int flags, iDate validUntil, const iString *commonName, | 406 | iGmIdentity *newIdentity_GmCerts(iGmCerts *d, int flags, iDate validUntil, const iString *commonName, |
407 | const iString *userId, const iString *org, | 407 | const iString *userId, const iString *domain, const iString *org, |
408 | const iString *country) { | 408 | const iString *country) { |
409 | const iTlsCertificateName names[] = { | 409 | const iTlsCertificateName names[] = { |
410 | { issuerCommonName_TlsCertificateNameType, collectNewCStr_String("fi.skyjake.Lagrange") }, | 410 | { issuerCommonName_TlsCertificateNameType, collectNewCStr_String("Lagrange v" LAGRANGE_APP_VERSION) }, |
411 | { issuerDomain_TlsCertificateNameType, collectNewCStr_String("lagrange.skyjake.fi") }, | ||
411 | { subjectCommonName_TlsCertificateNameType, commonName }, | 412 | { subjectCommonName_TlsCertificateNameType, commonName }, |
412 | { subjectUserId_TlsCertificateNameType, !isEmpty_String(userId) ? userId : NULL }, | 413 | { subjectUserId_TlsCertificateNameType, !isEmpty_String(userId) ? userId : NULL }, |
414 | { subjectDomain_TlsCertificateNameType, !isEmpty_String(domain) ? domain : NULL }, | ||
413 | { subjectOrganization_TlsCertificateNameType, !isEmpty_String(org) ? org : NULL }, | 415 | { subjectOrganization_TlsCertificateNameType, !isEmpty_String(org) ? org : NULL }, |
414 | { subjectCountry_TlsCertificateNameType, !isEmpty_String(country) ? country : NULL }, | 416 | { subjectCountry_TlsCertificateNameType, !isEmpty_String(country) ? country : NULL }, |
415 | { 0, NULL } | 417 | { 0, NULL } |
diff --git a/src/gmcerts.h b/src/gmcerts.h index 1730ca8e..04904d51 100644 --- a/src/gmcerts.h +++ b/src/gmcerts.h | |||
@@ -71,6 +71,7 @@ const iGmIdentity * identityForUrl_GmCerts (const iGmCerts *, const iString *ur | |||
71 | */ | 71 | */ |
72 | iGmIdentity * newIdentity_GmCerts (iGmCerts *, int flags, iDate validUntil, | 72 | iGmIdentity * newIdentity_GmCerts (iGmCerts *, int flags, iDate validUntil, |
73 | const iString *commonName, const iString *userId, | 73 | const iString *commonName, const iString *userId, |
74 | const iString *org, const iString *country); | 74 | const iString *domain, const iString *org, |
75 | const iString *country); | ||
75 | 76 | ||
76 | const iPtrArray * identities_GmCerts (const iGmCerts *); | 77 | const iPtrArray * identities_GmCerts (const iGmCerts *); |
diff --git a/src/ui/util.c b/src/ui/util.c index e6067ab9..770071a6 100644 --- a/src/ui/util.c +++ b/src/ui/util.c | |||
@@ -854,15 +854,17 @@ iWidget *makeIdentityCreation_Widget(void) { | |||
854 | page, iClob(new_Widget()), arrangeVertical_WidgetFlag | arrangeSize_WidgetFlag); | 854 | page, iClob(new_Widget()), arrangeVertical_WidgetFlag | arrangeSize_WidgetFlag); |
855 | iWidget *values = addChildFlags_Widget( | 855 | iWidget *values = addChildFlags_Widget( |
856 | page, iClob(new_Widget()), arrangeVertical_WidgetFlag | arrangeSize_WidgetFlag); | 856 | page, iClob(new_Widget()), arrangeVertical_WidgetFlag | arrangeSize_WidgetFlag); |
857 | iInputWidget *inputs[4]; | 857 | iInputWidget *inputs[5]; |
858 | addChild_Widget(headings, iClob(makeHeading_Widget("Common name:"))); | 858 | addChild_Widget(headings, iClob(makeHeading_Widget("Common name:"))); |
859 | setId_Widget(addChild_Widget(values, iClob(inputs[0] = new_InputWidget(0))), "ident.common"); | 859 | setId_Widget(addChild_Widget(values, iClob(inputs[0] = new_InputWidget(0))), "ident.common"); |
860 | addChild_Widget(headings, iClob(makeHeading_Widget("User ID:"))); | 860 | addChild_Widget(headings, iClob(makeHeading_Widget("User ID:"))); |
861 | setId_Widget(addChild_Widget(values, iClob(inputs[1] = newHint_InputWidget(0, "optional"))), "ident.userid"); | 861 | setId_Widget(addChild_Widget(values, iClob(inputs[1] = newHint_InputWidget(0, "optional"))), "ident.userid"); |
862 | addChild_Widget(headings, iClob(makeHeading_Widget("Domain:"))); | ||
863 | setId_Widget(addChild_Widget(values, iClob(inputs[2] = newHint_InputWidget(0, "optional"))), "ident.domain"); | ||
862 | addChild_Widget(headings, iClob(makeHeading_Widget("Organization:"))); | 864 | addChild_Widget(headings, iClob(makeHeading_Widget("Organization:"))); |
863 | setId_Widget(addChild_Widget(values, iClob(inputs[2] = newHint_InputWidget(0, "optional"))), "ident.org"); | 865 | setId_Widget(addChild_Widget(values, iClob(inputs[3] = newHint_InputWidget(0, "optional"))), "ident.org"); |
864 | addChild_Widget(headings, iClob(makeHeading_Widget("Country:"))); | 866 | addChild_Widget(headings, iClob(makeHeading_Widget("Country:"))); |
865 | setId_Widget(addChild_Widget(values, iClob(inputs[3] = newHint_InputWidget(0, "optional"))), "ident.country"); | 867 | setId_Widget(addChild_Widget(values, iClob(inputs[4] = newHint_InputWidget(0, "optional"))), "ident.country"); |
866 | addChild_Widget(headings, iClob(makeHeading_Widget("Valid until:"))); | 868 | addChild_Widget(headings, iClob(makeHeading_Widget("Valid until:"))); |
867 | setId_Widget(addChild_Widget(values, iClob(newHint_InputWidget(19, "YYYY-MM-DD HH:MM:SS"))), "ident.until"); | 869 | setId_Widget(addChild_Widget(values, iClob(newHint_InputWidget(19, "YYYY-MM-DD HH:MM:SS"))), "ident.until"); |
868 | addChild_Widget(headings, iClob(makeHeading_Widget("Temporary:"))); | 870 | addChild_Widget(headings, iClob(makeHeading_Widget("Temporary:"))); |