diff options
| -rw-r--r-- | sys/src/libsec/port/x509.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/sys/src/libsec/port/x509.c b/sys/src/libsec/port/x509.c index 4e151915a..1555210f3 100644 --- a/sys/src/libsec/port/x509.c +++ b/sys/src/libsec/port/x509.c @@ -2461,15 +2461,12 @@ static Elem mkbigint(mpint *p) { Elem e; - uchar *buf; - int buflen; e.tag.class = Universal; e.tag.num = INTEGER; e.val.tag = VBigInt; - buflen = mptobe(p, nil, 0, &buf); - e.val.u.bigintval = makebytes(buf, buflen); - free(buf); + e.val.u.bigintval = newbytes((mpsignif(p)+8)/8); + mptober(p, e.val.u.bigintval->data, e.val.u.bigintval->len); return e; } |
