summaryrefslogtreecommitdiff
path: root/sys/src/libsec
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2021-10-31 12:40:47 +0000
committercinap_lenrek <cinap_lenrek@felloff.net>2021-10-31 12:40:47 +0000
commit32665f51c7f5637e96fa0713584493e7060a8e98 (patch)
treebc8e27690ccb2cdf72e0e6d934d72ea6a46c84e1 /sys/src/libsec
parent9d15403fda575ab73c5501970fe3835265b05aee (diff)
libsec: no point in checking for "xn--" marker, just call idn2utf().
Diffstat (limited to 'sys/src/libsec')
-rw-r--r--sys/src/libsec/port/x509.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/src/libsec/port/x509.c b/sys/src/libsec/port/x509.c
index dc011c279..4fc6ca045 100644
--- a/sys/src/libsec/port/x509.c
+++ b/sys/src/libsec/port/x509.c
@@ -141,6 +141,10 @@ static void edump(Elem);
#define CLASS_MASK 0xC0
#define MAXOBJIDLEN 20
+enum {
+ Domlen = 256,
+};
+
static int ber_decode(uchar** pp, uchar* pend, Elem* pelem);
static int tag_decode(uchar** pp, uchar* pend, Tag* ptag, int* pisconstr);
static int length_decode(uchar** pp, uchar* pend, int* plength);
@@ -2268,8 +2272,7 @@ copysubject(char *name, int nname, char *subject)
}
strncpy(name, subject, i);
}
- if(strncmp(subject+i, "xn--", 4) != 0
- || idn2utf(subject+i, name+i, nname-i) < 0){
+ if(idn2utf(subject+i, name+i, nname-i) < 0){
botch:
strncpy(name+i, subject+i, nname-i);
}
@@ -2618,7 +2621,7 @@ mkcont(int num, Elist *l)
static Elem
mkaltname(char *s)
{
- char buf[256], *at;
+ char buf[Domlen], *at;
Elem e;
int i;
@@ -2734,7 +2737,7 @@ appendaltnames(char *name, int nname, Bytes *ext, int isreq)
Elem eext, ealt, edn;
Elist *el, *l;
Ints *oid;
- char *alt, *e, buf[256];
+ char *alt, *e, buf[Domlen];
int len;
if(name == nil || nname < 1 || ext == nil)