diff options
Diffstat (limited to 'src/lib/libcrypto/ec/ec_print.c')
| -rw-r--r-- | src/lib/libcrypto/ec/ec_print.c | 28 | 
1 files changed, 14 insertions, 14 deletions
| diff --git a/src/lib/libcrypto/ec/ec_print.c b/src/lib/libcrypto/ec/ec_print.c index f7c8a303ac..1655332c3c 100644 --- a/src/lib/libcrypto/ec/ec_print.c +++ b/src/lib/libcrypto/ec/ec_print.c | |||
| @@ -70,18 +70,18 @@ BIGNUM *EC_POINT_point2bn(const EC_GROUP *group, | |||
| 70 | if (buf_len == 0) | 70 | if (buf_len == 0) | 
| 71 | return NULL; | 71 | return NULL; | 
| 72 | 72 | ||
| 73 | if ((buf = OPENSSL_malloc(buf_len)) == NULL) | 73 | if ((buf = malloc(buf_len)) == NULL) | 
| 74 | return NULL; | 74 | return NULL; | 
| 75 | 75 | ||
| 76 | if (!EC_POINT_point2oct(group, point, form, buf, buf_len, ctx)) | 76 | if (!EC_POINT_point2oct(group, point, form, buf, buf_len, ctx)) | 
| 77 | { | 77 | { | 
| 78 | OPENSSL_free(buf); | 78 | free(buf); | 
| 79 | return NULL; | 79 | return NULL; | 
| 80 | } | 80 | } | 
| 81 | 81 | ||
| 82 | ret = BN_bin2bn(buf, buf_len, ret); | 82 | ret = BN_bin2bn(buf, buf_len, ret); | 
| 83 | 83 | ||
| 84 | OPENSSL_free(buf); | 84 | free(buf); | 
| 85 | 85 | ||
| 86 | return ret; | 86 | return ret; | 
| 87 | } | 87 | } | 
| @@ -96,13 +96,13 @@ EC_POINT *EC_POINT_bn2point(const EC_GROUP *group, | |||
| 96 | EC_POINT *ret; | 96 | EC_POINT *ret; | 
| 97 | 97 | ||
| 98 | if ((buf_len = BN_num_bytes(bn)) == 0) return NULL; | 98 | if ((buf_len = BN_num_bytes(bn)) == 0) return NULL; | 
| 99 | buf = OPENSSL_malloc(buf_len); | 99 | buf = malloc(buf_len); | 
| 100 | if (buf == NULL) | 100 | if (buf == NULL) | 
| 101 | return NULL; | 101 | return NULL; | 
| 102 | 102 | ||
| 103 | if (!BN_bn2bin(bn, buf)) | 103 | if (!BN_bn2bin(bn, buf)) | 
| 104 | { | 104 | { | 
| 105 | OPENSSL_free(buf); | 105 | free(buf); | 
| 106 | return NULL; | 106 | return NULL; | 
| 107 | } | 107 | } | 
| 108 | 108 | ||
| @@ -110,7 +110,7 @@ EC_POINT *EC_POINT_bn2point(const EC_GROUP *group, | |||
| 110 | { | 110 | { | 
| 111 | if ((ret = EC_POINT_new(group)) == NULL) | 111 | if ((ret = EC_POINT_new(group)) == NULL) | 
| 112 | { | 112 | { | 
| 113 | OPENSSL_free(buf); | 113 | free(buf); | 
| 114 | return NULL; | 114 | return NULL; | 
| 115 | } | 115 | } | 
| 116 | } | 116 | } | 
| @@ -121,17 +121,17 @@ EC_POINT *EC_POINT_bn2point(const EC_GROUP *group, | |||
| 121 | { | 121 | { | 
| 122 | if (point == NULL) | 122 | if (point == NULL) | 
| 123 | EC_POINT_clear_free(ret); | 123 | EC_POINT_clear_free(ret); | 
| 124 | OPENSSL_free(buf); | 124 | free(buf); | 
| 125 | return NULL; | 125 | return NULL; | 
| 126 | } | 126 | } | 
| 127 | 127 | ||
| 128 | OPENSSL_free(buf); | 128 | free(buf); | 
| 129 | return ret; | 129 | return ret; | 
| 130 | } | 130 | } | 
| 131 | 131 | ||
| 132 | static const char *HEX_DIGITS = "0123456789ABCDEF"; | 132 | static const char *HEX_DIGITS = "0123456789ABCDEF"; | 
| 133 | 133 | ||
| 134 | /* the return value must be freed (using OPENSSL_free()) */ | 134 | /* the return value must be freed (using free()) */ | 
| 135 | char *EC_POINT_point2hex(const EC_GROUP *group, | 135 | char *EC_POINT_point2hex(const EC_GROUP *group, | 
| 136 | const EC_POINT *point, | 136 | const EC_POINT *point, | 
| 137 | point_conversion_form_t form, | 137 | point_conversion_form_t form, | 
| @@ -146,19 +146,19 @@ char *EC_POINT_point2hex(const EC_GROUP *group, | |||
| 146 | if (buf_len == 0) | 146 | if (buf_len == 0) | 
| 147 | return NULL; | 147 | return NULL; | 
| 148 | 148 | ||
| 149 | if ((buf = OPENSSL_malloc(buf_len)) == NULL) | 149 | if ((buf = malloc(buf_len)) == NULL) | 
| 150 | return NULL; | 150 | return NULL; | 
| 151 | 151 | ||
| 152 | if (!EC_POINT_point2oct(group, point, form, buf, buf_len, ctx)) | 152 | if (!EC_POINT_point2oct(group, point, form, buf, buf_len, ctx)) | 
| 153 | { | 153 | { | 
| 154 | OPENSSL_free(buf); | 154 | free(buf); | 
| 155 | return NULL; | 155 | return NULL; | 
| 156 | } | 156 | } | 
| 157 | 157 | ||
| 158 | ret = (char *)OPENSSL_malloc(buf_len*2+2); | 158 | ret = (char *)malloc(buf_len*2+2); | 
| 159 | if (ret == NULL) | 159 | if (ret == NULL) | 
| 160 | { | 160 | { | 
| 161 | OPENSSL_free(buf); | 161 | free(buf); | 
| 162 | return NULL; | 162 | return NULL; | 
| 163 | } | 163 | } | 
| 164 | p = ret; | 164 | p = ret; | 
| @@ -171,7 +171,7 @@ char *EC_POINT_point2hex(const EC_GROUP *group, | |||
| 171 | } | 171 | } | 
| 172 | *p='\0'; | 172 | *p='\0'; | 
| 173 | 173 | ||
| 174 | OPENSSL_free(buf); | 174 | free(buf); | 
| 175 | 175 | ||
| 176 | return ret; | 176 | return ret; | 
| 177 | } | 177 | } | 
