summaryrefslogtreecommitdiff
path: root/sys/include/libsec.h
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2021-07-04 22:00:24 +0000
committercinap_lenrek <cinap_lenrek@felloff.net>2021-07-04 22:00:24 +0000
commit88060e7501de5c117b86e1d29bc24ec8e83141a8 (patch)
tree3332d6fea36e77c622b81995cb3cb22465abbddc /sys/include/libsec.h
parent7010ad85c5a5648ea86d4f17a6b1547c10823938 (diff)
libsec: add X509reqtoRSApub() function and return subject alt names in X509to*pub() name buffer
We need a way to parse a rsa certificate request and return the public key and subject names. The new function X509reqtoRSApub() works the same way as X509toRSApub() but on a certificate request. We also need to support certificates that are valid for multiple domain names (as tlshand does not support certificate selection). For this reason, a comma separated list is returned as the certificate subject, making it symmetric to X509rsareq() handling. A little helper is provided with this change (auth/x5092pub) that takes a certificate (or a certificate request when -r flag is provided) and outputs the RSA public key in plan 9 format appended with the subject attribute.
Diffstat (limited to 'sys/include/libsec.h')
-rw-r--r--sys/include/libsec.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/include/libsec.h b/sys/include/libsec.h
index bebcc98fe..884ff4c10 100644
--- a/sys/include/libsec.h
+++ b/sys/include/libsec.h
@@ -357,6 +357,7 @@ RSApriv* rsaprivalloc(void);
void rsaprivfree(RSApriv*);
RSApub* rsaprivtopub(RSApriv*);
RSApub* X509toRSApub(uchar*, int, char*, int);
+RSApub* X509reqtoRSApub(uchar*, int, char*, int);
RSApub* asn1toRSApub(uchar*, int);
RSApriv* asn1toRSApriv(uchar*, int);
void asn1dump(uchar *der, int len);