ref: fd1a984ff0bbd2cf91adad5adfa1f61f2cd1ad93
parent: 75e61c07caf6cd4599445f6e986cb4403e1f982a
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sat Jan 6 04:18:11 EST 2018
libsec: remove asn1toDSApriv()
--- a/include/libsec.h
+++ b/include/libsec.h
@@ -452,7 +452,6 @@
DSAsig* dsasigalloc(void);
void dsasigfree(DSAsig*);
DSApub* dsaprivtopub(DSApriv*);
-DSApriv* asn1toDSApriv(uchar*, int);
/*
* TLS
--- a/libsec/x509.c
+++ b/libsec/x509.c
@@ -2084,61 +2084,6 @@
}
/*
- * DSAPrivateKey ::= SEQUENCE{
- * version Version,
- * p INTEGER,
- * q INTEGER,
- * g INTEGER, -- alpha
- * pub_key INTEGER, -- key
- * priv_key INTEGER, -- secret
- * }
- */
-DSApriv*
-asn1toDSApriv(uchar *buf, int len)
-{
- int version;
- Elem e;
- Elist *el;
- DSApriv* key = nil;
-
- if(decode(buf, len, &e) != ASN_OK)
- goto errret;
- if(!is_seq(&e, &el) || elistlen(el) != 6)
- goto errret;
- version = -1;
- if(!is_int(&el->hd, &version) || version != 0)
- goto errret;
-
- key = dsaprivalloc();
- el = el->tl;
- if((key->pub.p = asn1mpint(&el->hd)) == nil)
- goto errret;
-
- el = el->tl;
- if((key->pub.q = asn1mpint(&el->hd)) == nil)
- goto errret;
-
- el = el->tl;
- if((key->pub.alpha = asn1mpint(&el->hd)) == nil)
- goto errret;
-
- el = el->tl;
- if((key->pub.key = asn1mpint(&el->hd)) == nil)
- goto errret;
-
- el = el->tl;
- if((key->secret = asn1mpint(&el->hd)) == nil)
- goto errret;
-
- freevalfields(&e.val);
- return key;
-errret:
- freevalfields(&e.val);
- dsaprivfree(key);
- return nil;
-}
-
-/*
* digest(CertificateInfo)
* Our ASN.1 library doesn't return pointers into the original
* data array, so we need to do a little hand decoding.