libsec: remove asn1toDSApriv()

This commit is contained in:
cinap_lenrek 2018-01-06 08:34:25 +01:00
parent a200ecd3a6
commit 8ff72ce20d
3 changed files with 0 additions and 57 deletions

View file

@ -465,7 +465,6 @@ void dsaprivfree(DSApriv*);
DSAsig* dsasigalloc(void);
void dsasigfree(DSAsig*);
DSApub* dsaprivtopub(DSApriv*);
DSApriv* asn1toDSApriv(uchar*, int);
/*
* TLS

View file

@ -457,7 +457,6 @@ void dsaprivfree(DSApriv*);
DSAsig* dsasigalloc(void);
void dsasigfree(DSAsig*);
DSApub* dsaprivtopub(DSApriv*);
DSApriv* asn1toDSApriv(uchar*, int);
/*
* TLS

View file

@ -2083,61 +2083,6 @@ errret:
return nil;
}
/*
* 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