History

libsec: remove asn1toDSApriv()

cinap_lenrek committed 8 years ago

Commit fd1a9841 parent 75e61c02 files · +0 −56Browse files

Unified · Split

2 files
  1. include/libsec.h +0 −1
  2. libsec/x509.c +0 −55
include/libsec.h+0−1
@@ -452,7 +452,6 @@ void dsaprivfree(DSApriv*); · 451 unmodified lines
452DSAsig* dsasigalloc(void);452DSAsig* dsasigalloc(void);
453void dsasigfree(DSAsig*);453void dsasigfree(DSAsig*);
454DSApub* dsaprivtopub(DSApriv*);454DSApub* dsaprivtopub(DSApriv*);
455DSApriv* asn1toDSApriv(uchar*, int);
456 455
457/*456/*
458 * TLS457 * TLS
libsec/x509.c+0−55
@@ -2083,61 +2083,6 @@ errret: · 2082 unmodified lines
2083 return nil;2083 return nil;
2084}2084}
2085 2085
2086/*
2087 * DSAPrivateKey ::= SEQUENCE{
2088 * version Version,
2089 * p INTEGER,
2090 * q INTEGER,
2091 * g INTEGER, -- alpha
2092 * pub_key INTEGER, -- key
2093 * priv_key INTEGER, -- secret
2094 * }
2095 */
2096DSApriv*
2097asn1toDSApriv(uchar *buf, int len)
2098{
2099 int version;
2100 Elem e;
2101 Elist *el;
2102 DSApriv* key = nil;
2103
2104 if(decode(buf, len, &e) != ASN_OK)
2105 goto errret;
2106 if(!is_seq(&e, &el) || elistlen(el) != 6)
2107 goto errret;
2108 version = -1;
2109 if(!is_int(&el->hd, &version) || version != 0)
2110 goto errret;
2111
2112 key = dsaprivalloc();
2113 el = el->tl;
2114 if((key->pub.p = asn1mpint(&el->hd)) == nil)
2115 goto errret;
2116
2117 el = el->tl;
2118 if((key->pub.q = asn1mpint(&el->hd)) == nil)
2119 goto errret;
2120
2121 el = el->tl;
2122 if((key->pub.alpha = asn1mpint(&el->hd)) == nil)
2123 goto errret;
2124
2125 el = el->tl;
2126 if((key->pub.key = asn1mpint(&el->hd)) == nil)
2127 goto errret;
2128
2129 el = el->tl;
2130 if((key->secret = asn1mpint(&el->hd)) == nil)
2131 goto errret;
2132
2133 freevalfields(&e.val);
2134 return key;
2135errret:
2136 freevalfields(&e.val);
2137 dsaprivfree(key);
2138 return nil;
2139}
2140
2141/*2086/*
2142 * digest(CertificateInfo)2087 * digest(CertificateInfo)
2143 * Our ASN.1 library doesn't return pointers into the original2088 * Our ASN.1 library doesn't return pointers into the original

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t