diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2000-12-08 19:09:35 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2000-12-08 19:09:35 +0000 |
commit | 9d6b1ce6441c7cc6aed344f02d9f676ab5e04217 (patch) | |
tree | 7329435a21d3289cb3caad6d3d6c065f484373e1 /crypto/asn1/a_int.c | |
parent | 66ebbb6a56bc1688fa37878e4feec985b0c260d7 (diff) |
Merge from the ASN1 branch of new ASN1 code
to main trunk.
Lets see if the makes it to openssl-cvs :-)
Diffstat (limited to 'crypto/asn1/a_int.c')
-rw-r--r-- | crypto/asn1/a_int.c | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/crypto/asn1/a_int.c b/crypto/asn1/a_int.c index 6f0413f885..c18376be48 100644 --- a/crypto/asn1/a_int.c +++ b/crypto/asn1/a_int.c @@ -60,33 +60,12 @@ #include "cryptlib.h" #include <openssl/asn1.h> -ASN1_INTEGER *ASN1_INTEGER_new(void) -{ return M_ASN1_INTEGER_new();} - -void ASN1_INTEGER_free(ASN1_INTEGER *x) -{ M_ASN1_INTEGER_free(x);} - ASN1_INTEGER *ASN1_INTEGER_dup(ASN1_INTEGER *x) { return M_ASN1_INTEGER_dup(x);} int ASN1_INTEGER_cmp(ASN1_INTEGER *x, ASN1_INTEGER *y) { return M_ASN1_INTEGER_cmp(x,y);} -/* Output ASN1 INTEGER including tag+length */ - -int i2d_ASN1_INTEGER(ASN1_INTEGER *a, unsigned char **pp) -{ - int len, ret; - if(!a) return 0; - len = i2c_ASN1_INTEGER(a, NULL); - ret=ASN1_object_size(0,len,V_ASN1_INTEGER); - if(pp) { - ASN1_put_object(pp,0,len,V_ASN1_INTEGER,V_ASN1_UNIVERSAL); - i2c_ASN1_INTEGER(a, pp); - } - return ret; -} - /* * This converts an ASN1 INTEGER into its content encoding. * The internal representation is an ASN1_STRING whose data is a big endian @@ -174,39 +153,6 @@ int i2c_ASN1_INTEGER(ASN1_INTEGER *a, unsigned char **pp) return(ret); } -/* Convert DER encoded ASN1 INTEGER to ASN1_INTEGER structure */ -ASN1_INTEGER *d2i_ASN1_INTEGER(ASN1_INTEGER **a, unsigned char **pp, - long length) -{ - unsigned char *p; - long len; - int i; - int inf,tag,xclass; - ASN1_INTEGER *ret; - - p= *pp; - inf=ASN1_get_object(&p,&len,&tag,&xclass,length); - if (inf & 0x80) - { - i=ASN1_R_BAD_OBJECT_HEADER; - goto err; - } - - if (tag != V_ASN1_INTEGER) - { - i=ASN1_R_EXPECTING_AN_INTEGER; - goto err; - } - ret = c2i_ASN1_INTEGER(a, &p, len); - if(ret) *pp = p; - return ret; -err: - ASN1err(ASN1_F_D2I_ASN1_INTEGER,i); - return(NULL); - -} - - /* Convert just ASN1 INTEGER content octets to ASN1_INTEGER structure */ ASN1_INTEGER *c2i_ASN1_INTEGER(ASN1_INTEGER **a, unsigned char **pp, |