libsec: remove asn1toDSApriv()
This commit is contained in:
parent
a200ecd3a6
commit
8ff72ce20d
3 changed files with 0 additions and 57 deletions
|
@ -465,7 +465,6 @@ void dsaprivfree(DSApriv*);
|
||||||
DSAsig* dsasigalloc(void);
|
DSAsig* dsasigalloc(void);
|
||||||
void dsasigfree(DSAsig*);
|
void dsasigfree(DSAsig*);
|
||||||
DSApub* dsaprivtopub(DSApriv*);
|
DSApub* dsaprivtopub(DSApriv*);
|
||||||
DSApriv* asn1toDSApriv(uchar*, int);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* TLS
|
* TLS
|
||||||
|
|
|
@ -457,7 +457,6 @@ void dsaprivfree(DSApriv*);
|
||||||
DSAsig* dsasigalloc(void);
|
DSAsig* dsasigalloc(void);
|
||||||
void dsasigfree(DSAsig*);
|
void dsasigfree(DSAsig*);
|
||||||
DSApub* dsaprivtopub(DSApriv*);
|
DSApub* dsaprivtopub(DSApriv*);
|
||||||
DSApriv* asn1toDSApriv(uchar*, int);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* TLS
|
* TLS
|
||||||
|
|
|
@ -2083,61 +2083,6 @@ errret:
|
||||||
return nil;
|
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)
|
* digest(CertificateInfo)
|
||||||
* Our ASN.1 library doesn't return pointers into the original
|
* Our ASN.1 library doesn't return pointers into the original
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue