diff options
author | djm <> | 2005-04-29 05:37:34 +0000 |
---|---|---|
committer | djm <> | 2005-04-29 05:37:34 +0000 |
commit | a95585a25ab25668b931a78b7543f707a3354db8 (patch) | |
tree | f9e9febf7ac0c8f5d6df761fe70fd613aac06203 /src/lib/libcrypto/asn1/a_int.c | |
parent | 58c08aa241f168c84ce7cc3052454ea59a44eada (diff) | |
download | openbsd-a95585a25ab25668b931a78b7543f707a3354db8.tar.gz openbsd-a95585a25ab25668b931a78b7543f707a3354db8.tar.bz2 openbsd-a95585a25ab25668b931a78b7543f707a3354db8.zip |
import of openssl-0.9.7g; tested on platforms from alpha to zaurus, ok deraadt@
Diffstat (limited to 'src/lib/libcrypto/asn1/a_int.c')
-rw-r--r-- | src/lib/libcrypto/asn1/a_int.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/lib/libcrypto/asn1/a_int.c b/src/lib/libcrypto/asn1/a_int.c index edb243c021..21cc64bb23 100644 --- a/src/lib/libcrypto/asn1/a_int.c +++ b/src/lib/libcrypto/asn1/a_int.c | |||
@@ -64,7 +64,26 @@ ASN1_INTEGER *ASN1_INTEGER_dup(ASN1_INTEGER *x) | |||
64 | { return M_ASN1_INTEGER_dup(x);} | 64 | { return M_ASN1_INTEGER_dup(x);} |
65 | 65 | ||
66 | int ASN1_INTEGER_cmp(ASN1_INTEGER *x, ASN1_INTEGER *y) | 66 | int ASN1_INTEGER_cmp(ASN1_INTEGER *x, ASN1_INTEGER *y) |
67 | { return M_ASN1_INTEGER_cmp(x,y);} | 67 | { |
68 | int neg, ret; | ||
69 | /* Compare signs */ | ||
70 | neg = x->type & V_ASN1_NEG; | ||
71 | if (neg != (y->type & V_ASN1_NEG)) | ||
72 | { | ||
73 | if (neg) | ||
74 | return -1; | ||
75 | else | ||
76 | return 1; | ||
77 | } | ||
78 | |||
79 | ret = ASN1_STRING_cmp(x, y); | ||
80 | |||
81 | if (neg) | ||
82 | return -ret; | ||
83 | else | ||
84 | return ret; | ||
85 | } | ||
86 | |||
68 | 87 | ||
69 | /* | 88 | /* |
70 | * This converts an ASN1 INTEGER into its content encoding. | 89 | * This converts an ASN1 INTEGER into its content encoding. |