diff options
author | miod <> | 2014-07-13 15:42:42 +0000 |
---|---|---|
committer | miod <> | 2014-07-13 15:42:42 +0000 |
commit | 495f480ded737ca50a469ed12d410b9ff8bce996 (patch) | |
tree | 74050903722dacddb717e47b332eb7e0ac572e58 /src/lib | |
parent | cba45fbd725357be36de539c7ac2dc1c2e67ab27 (diff) | |
download | openbsd-495f480ded737ca50a469ed12d410b9ff8bce996.tar.gz openbsd-495f480ded737ca50a469ed12d410b9ff8bce996.tar.bz2 openbsd-495f480ded737ca50a469ed12d410b9ff8bce996.zip |
OPENSSL_{malloc,free} -> {malloc,free}
Diffstat (limited to 'src/lib')
19 files changed, 27 insertions, 27 deletions
diff --git a/src/lib/libcrypto/doc/EC_POINT_new.pod b/src/lib/libcrypto/doc/EC_POINT_new.pod index 69eb0d1a09..b41ca0ed0c 100644 --- a/src/lib/libcrypto/doc/EC_POINT_new.pod +++ b/src/lib/libcrypto/doc/EC_POINT_new.pod | |||
@@ -91,7 +91,7 @@ The function EC_POINT_point2oct must be supplied with a buffer long enough to st | |||
91 | octets stored. Calling the function with a NULL buffer will not perform the conversion but will still return the required buffer length. | 91 | octets stored. Calling the function with a NULL buffer will not perform the conversion but will still return the required buffer length. |
92 | 92 | ||
93 | The function EC_POINT_point2hex will allocate sufficient memory to store the hexadecimal string. It is the caller's responsibility to free | 93 | The function EC_POINT_point2hex will allocate sufficient memory to store the hexadecimal string. It is the caller's responsibility to free |
94 | this memory with a subsequent call to OPENSSL_free(). | 94 | this memory with a subsequent call to free(). |
95 | 95 | ||
96 | =head1 RETURN VALUES | 96 | =head1 RETURN VALUES |
97 | 97 | ||
diff --git a/src/lib/libcrypto/doc/ERR_get_error.pod b/src/lib/libcrypto/doc/ERR_get_error.pod index 01e196c95f..460a79f3f6 100644 --- a/src/lib/libcrypto/doc/ERR_get_error.pod +++ b/src/lib/libcrypto/doc/ERR_get_error.pod | |||
@@ -55,7 +55,7 @@ and *B<flags>, unless these are B<NULL>. *B<data> contains a string | |||
55 | if *B<flags>&B<ERR_TXT_STRING> is true. | 55 | if *B<flags>&B<ERR_TXT_STRING> is true. |
56 | 56 | ||
57 | An application B<MUST NOT> free the *B<data> pointer (or any other pointers | 57 | An application B<MUST NOT> free the *B<data> pointer (or any other pointers |
58 | returned by these functions) with OPENSSL_free() as freeing is handled | 58 | returned by these functions) with free() as freeing is handled |
59 | automatically by the error library. | 59 | automatically by the error library. |
60 | 60 | ||
61 | =head1 RETURN VALUES | 61 | =head1 RETURN VALUES |
diff --git a/src/lib/libcrypto/doc/EVP_PKEY_decrypt.pod b/src/lib/libcrypto/doc/EVP_PKEY_decrypt.pod index 197878eff7..d22b900024 100644 --- a/src/lib/libcrypto/doc/EVP_PKEY_decrypt.pod +++ b/src/lib/libcrypto/doc/EVP_PKEY_decrypt.pod | |||
@@ -67,7 +67,7 @@ Decrypt data using OAEP (for RSA keys): | |||
67 | if (EVP_PKEY_decrypt(ctx, NULL, &outlen, in, inlen) <= 0) | 67 | if (EVP_PKEY_decrypt(ctx, NULL, &outlen, in, inlen) <= 0) |
68 | /* Error */ | 68 | /* Error */ |
69 | 69 | ||
70 | out = OPENSSL_malloc(outlen); | 70 | out = malloc(outlen); |
71 | 71 | ||
72 | if (!out) | 72 | if (!out) |
73 | /* malloc failure */ | 73 | /* malloc failure */ |
diff --git a/src/lib/libcrypto/doc/EVP_PKEY_derive.pod b/src/lib/libcrypto/doc/EVP_PKEY_derive.pod index 2424ce0e54..09654e1b81 100644 --- a/src/lib/libcrypto/doc/EVP_PKEY_derive.pod +++ b/src/lib/libcrypto/doc/EVP_PKEY_derive.pod | |||
@@ -68,7 +68,7 @@ Derive shared secret (for example DH or EC keys): | |||
68 | if (EVP_PKEY_derive(ctx, NULL, &skeylen) <= 0) | 68 | if (EVP_PKEY_derive(ctx, NULL, &skeylen) <= 0) |
69 | /* Error */ | 69 | /* Error */ |
70 | 70 | ||
71 | skey = OPENSSL_malloc(skeylen); | 71 | skey = malloc(skeylen); |
72 | 72 | ||
73 | if (!skey) | 73 | if (!skey) |
74 | /* malloc failure */ | 74 | /* malloc failure */ |
diff --git a/src/lib/libcrypto/doc/EVP_PKEY_encrypt.pod b/src/lib/libcrypto/doc/EVP_PKEY_encrypt.pod index f7969c296f..b0bfe5d5dc 100644 --- a/src/lib/libcrypto/doc/EVP_PKEY_encrypt.pod +++ b/src/lib/libcrypto/doc/EVP_PKEY_encrypt.pod | |||
@@ -67,7 +67,7 @@ Encrypt data using OAEP (for RSA keys): | |||
67 | if (EVP_PKEY_encrypt(ctx, NULL, &outlen, in, inlen) <= 0) | 67 | if (EVP_PKEY_encrypt(ctx, NULL, &outlen, in, inlen) <= 0) |
68 | /* Error */ | 68 | /* Error */ |
69 | 69 | ||
70 | out = OPENSSL_malloc(outlen); | 70 | out = malloc(outlen); |
71 | 71 | ||
72 | if (!out) | 72 | if (!out) |
73 | /* malloc failure */ | 73 | /* malloc failure */ |
diff --git a/src/lib/libcrypto/doc/EVP_PKEY_sign.pod b/src/lib/libcrypto/doc/EVP_PKEY_sign.pod index fb8e61cf29..1925706d96 100644 --- a/src/lib/libcrypto/doc/EVP_PKEY_sign.pod +++ b/src/lib/libcrypto/doc/EVP_PKEY_sign.pod | |||
@@ -69,7 +69,7 @@ Sign data using RSA with PKCS#1 padding and SHA256 digest: | |||
69 | if (EVP_PKEY_sign(ctx, NULL, &siglen, md, mdlen) <= 0) | 69 | if (EVP_PKEY_sign(ctx, NULL, &siglen, md, mdlen) <= 0) |
70 | /* Error */ | 70 | /* Error */ |
71 | 71 | ||
72 | sig = OPENSSL_malloc(siglen); | 72 | sig = malloc(siglen); |
73 | 73 | ||
74 | if (!sig) | 74 | if (!sig) |
75 | /* malloc failure */ | 75 | /* malloc failure */ |
diff --git a/src/lib/libcrypto/doc/EVP_PKEY_verify_recover.pod b/src/lib/libcrypto/doc/EVP_PKEY_verify_recover.pod index 4debf7bff0..095e53ea2f 100644 --- a/src/lib/libcrypto/doc/EVP_PKEY_verify_recover.pod +++ b/src/lib/libcrypto/doc/EVP_PKEY_verify_recover.pod | |||
@@ -79,7 +79,7 @@ Recover digest originally signed using PKCS#1 and SHA256 digest: | |||
79 | if (EVP_PKEY_verify_recover(ctx, NULL, &routlen, sig, siglen) <= 0) | 79 | if (EVP_PKEY_verify_recover(ctx, NULL, &routlen, sig, siglen) <= 0) |
80 | /* Error */ | 80 | /* Error */ |
81 | 81 | ||
82 | rout = OPENSSL_malloc(routlen); | 82 | rout = malloc(routlen); |
83 | 83 | ||
84 | if (!rout) | 84 | if (!rout) |
85 | /* malloc failure */ | 85 | /* malloc failure */ |
diff --git a/src/lib/libcrypto/doc/d2i_X509.pod b/src/lib/libcrypto/doc/d2i_X509.pod index e212014ac8..fad4e8c35b 100644 --- a/src/lib/libcrypto/doc/d2i_X509.pod +++ b/src/lib/libcrypto/doc/d2i_X509.pod | |||
@@ -91,7 +91,7 @@ Allocate and encode the DER encoding of an X509 structure: | |||
91 | 91 | ||
92 | len = i2d_X509(x, NULL); | 92 | len = i2d_X509(x, NULL); |
93 | 93 | ||
94 | buf = OPENSSL_malloc(len); | 94 | buf = malloc(len); |
95 | 95 | ||
96 | if (buf == NULL) | 96 | if (buf == NULL) |
97 | /* error */ | 97 | /* error */ |
@@ -159,7 +159,7 @@ mistake is to attempt to use a buffer directly as follows: | |||
159 | 159 | ||
160 | len = i2d_X509(x, NULL); | 160 | len = i2d_X509(x, NULL); |
161 | 161 | ||
162 | buf = OPENSSL_malloc(len); | 162 | buf = malloc(len); |
163 | 163 | ||
164 | if (buf == NULL) | 164 | if (buf == NULL) |
165 | /* error */ | 165 | /* error */ |
@@ -168,12 +168,12 @@ mistake is to attempt to use a buffer directly as follows: | |||
168 | 168 | ||
169 | /* Other stuff ... */ | 169 | /* Other stuff ... */ |
170 | 170 | ||
171 | OPENSSL_free(buf); | 171 | free(buf); |
172 | 172 | ||
173 | This code will result in B<buf> apparently containing garbage because | 173 | This code will result in B<buf> apparently containing garbage because |
174 | it was incremented after the call to point after the data just written. | 174 | it was incremented after the call to point after the data just written. |
175 | Also B<buf> will no longer contain the pointer allocated by B<OPENSSL_malloc()> | 175 | Also B<buf> will no longer contain the pointer allocated by B<malloc()> |
176 | and the subsequent call to B<OPENSSL_free()> may well crash. | 176 | and the subsequent call to B<free()> may well crash. |
177 | 177 | ||
178 | The auto allocation feature (setting buf to NULL) only works on OpenSSL | 178 | The auto allocation feature (setting buf to NULL) only works on OpenSSL |
179 | 0.9.7 and later. Attempts to use it on earlier versions will typically | 179 | 0.9.7 and later. Attempts to use it on earlier versions will typically |
diff --git a/src/lib/libssl/src/doc/crypto/ASN1_STRING_length.pod b/src/lib/libssl/src/doc/crypto/ASN1_STRING_length.pod index f651e4f2ae..f9a47a47dc 100644 --- a/src/lib/libssl/src/doc/crypto/ASN1_STRING_length.pod +++ b/src/lib/libssl/src/doc/crypto/ASN1_STRING_length.pod | |||
@@ -48,7 +48,7 @@ such as B<V_ASN1_OCTET_STRING>. | |||
48 | ASN1_STRING_to_UTF8() converts the string B<in> to UTF8 format, the | 48 | ASN1_STRING_to_UTF8() converts the string B<in> to UTF8 format, the |
49 | converted data is allocated in a buffer in B<*out>. The length of | 49 | converted data is allocated in a buffer in B<*out>. The length of |
50 | B<out> is returned or a negative error code. The buffer B<*out> | 50 | B<out> is returned or a negative error code. The buffer B<*out> |
51 | should be free using OPENSSL_free(). | 51 | should be free using free(). |
52 | 52 | ||
53 | =head1 NOTES | 53 | =head1 NOTES |
54 | 54 | ||
diff --git a/src/lib/libssl/src/doc/crypto/BN_bn2bin.pod b/src/lib/libssl/src/doc/crypto/BN_bn2bin.pod index a4b17ca60a..03b439c7b9 100644 --- a/src/lib/libssl/src/doc/crypto/BN_bn2bin.pod +++ b/src/lib/libssl/src/doc/crypto/BN_bn2bin.pod | |||
@@ -36,7 +36,7 @@ NULL, a new B<BIGNUM> is created. | |||
36 | BN_bn2hex() and BN_bn2dec() return printable strings containing the | 36 | BN_bn2hex() and BN_bn2dec() return printable strings containing the |
37 | hexadecimal and decimal encoding of B<a> respectively. For negative | 37 | hexadecimal and decimal encoding of B<a> respectively. For negative |
38 | numbers, the string is prefaced with a leading '-'. The string must be | 38 | numbers, the string is prefaced with a leading '-'. The string must be |
39 | freed later using OPENSSL_free(). | 39 | freed later using free(). |
40 | 40 | ||
41 | BN_hex2bn() converts the string B<str> containing a hexadecimal number | 41 | BN_hex2bn() converts the string B<str> containing a hexadecimal number |
42 | to a B<BIGNUM> and stores it in **B<bn>. If *B<bn> is NULL, a new | 42 | to a B<BIGNUM> and stores it in **B<bn>. If *B<bn> is NULL, a new |
diff --git a/src/lib/libssl/src/doc/crypto/EC_POINT_new.pod b/src/lib/libssl/src/doc/crypto/EC_POINT_new.pod index 69eb0d1a09..b41ca0ed0c 100644 --- a/src/lib/libssl/src/doc/crypto/EC_POINT_new.pod +++ b/src/lib/libssl/src/doc/crypto/EC_POINT_new.pod | |||
@@ -91,7 +91,7 @@ The function EC_POINT_point2oct must be supplied with a buffer long enough to st | |||
91 | octets stored. Calling the function with a NULL buffer will not perform the conversion but will still return the required buffer length. | 91 | octets stored. Calling the function with a NULL buffer will not perform the conversion but will still return the required buffer length. |
92 | 92 | ||
93 | The function EC_POINT_point2hex will allocate sufficient memory to store the hexadecimal string. It is the caller's responsibility to free | 93 | The function EC_POINT_point2hex will allocate sufficient memory to store the hexadecimal string. It is the caller's responsibility to free |
94 | this memory with a subsequent call to OPENSSL_free(). | 94 | this memory with a subsequent call to free(). |
95 | 95 | ||
96 | =head1 RETURN VALUES | 96 | =head1 RETURN VALUES |
97 | 97 | ||
diff --git a/src/lib/libssl/src/doc/crypto/ERR_get_error.pod b/src/lib/libssl/src/doc/crypto/ERR_get_error.pod index 01e196c95f..460a79f3f6 100644 --- a/src/lib/libssl/src/doc/crypto/ERR_get_error.pod +++ b/src/lib/libssl/src/doc/crypto/ERR_get_error.pod | |||
@@ -55,7 +55,7 @@ and *B<flags>, unless these are B<NULL>. *B<data> contains a string | |||
55 | if *B<flags>&B<ERR_TXT_STRING> is true. | 55 | if *B<flags>&B<ERR_TXT_STRING> is true. |
56 | 56 | ||
57 | An application B<MUST NOT> free the *B<data> pointer (or any other pointers | 57 | An application B<MUST NOT> free the *B<data> pointer (or any other pointers |
58 | returned by these functions) with OPENSSL_free() as freeing is handled | 58 | returned by these functions) with free() as freeing is handled |
59 | automatically by the error library. | 59 | automatically by the error library. |
60 | 60 | ||
61 | =head1 RETURN VALUES | 61 | =head1 RETURN VALUES |
diff --git a/src/lib/libssl/src/doc/crypto/EVP_PKEY_decrypt.pod b/src/lib/libssl/src/doc/crypto/EVP_PKEY_decrypt.pod index 197878eff7..d22b900024 100644 --- a/src/lib/libssl/src/doc/crypto/EVP_PKEY_decrypt.pod +++ b/src/lib/libssl/src/doc/crypto/EVP_PKEY_decrypt.pod | |||
@@ -67,7 +67,7 @@ Decrypt data using OAEP (for RSA keys): | |||
67 | if (EVP_PKEY_decrypt(ctx, NULL, &outlen, in, inlen) <= 0) | 67 | if (EVP_PKEY_decrypt(ctx, NULL, &outlen, in, inlen) <= 0) |
68 | /* Error */ | 68 | /* Error */ |
69 | 69 | ||
70 | out = OPENSSL_malloc(outlen); | 70 | out = malloc(outlen); |
71 | 71 | ||
72 | if (!out) | 72 | if (!out) |
73 | /* malloc failure */ | 73 | /* malloc failure */ |
diff --git a/src/lib/libssl/src/doc/crypto/EVP_PKEY_derive.pod b/src/lib/libssl/src/doc/crypto/EVP_PKEY_derive.pod index 2424ce0e54..09654e1b81 100644 --- a/src/lib/libssl/src/doc/crypto/EVP_PKEY_derive.pod +++ b/src/lib/libssl/src/doc/crypto/EVP_PKEY_derive.pod | |||
@@ -68,7 +68,7 @@ Derive shared secret (for example DH or EC keys): | |||
68 | if (EVP_PKEY_derive(ctx, NULL, &skeylen) <= 0) | 68 | if (EVP_PKEY_derive(ctx, NULL, &skeylen) <= 0) |
69 | /* Error */ | 69 | /* Error */ |
70 | 70 | ||
71 | skey = OPENSSL_malloc(skeylen); | 71 | skey = malloc(skeylen); |
72 | 72 | ||
73 | if (!skey) | 73 | if (!skey) |
74 | /* malloc failure */ | 74 | /* malloc failure */ |
diff --git a/src/lib/libssl/src/doc/crypto/EVP_PKEY_encrypt.pod b/src/lib/libssl/src/doc/crypto/EVP_PKEY_encrypt.pod index f7969c296f..b0bfe5d5dc 100644 --- a/src/lib/libssl/src/doc/crypto/EVP_PKEY_encrypt.pod +++ b/src/lib/libssl/src/doc/crypto/EVP_PKEY_encrypt.pod | |||
@@ -67,7 +67,7 @@ Encrypt data using OAEP (for RSA keys): | |||
67 | if (EVP_PKEY_encrypt(ctx, NULL, &outlen, in, inlen) <= 0) | 67 | if (EVP_PKEY_encrypt(ctx, NULL, &outlen, in, inlen) <= 0) |
68 | /* Error */ | 68 | /* Error */ |
69 | 69 | ||
70 | out = OPENSSL_malloc(outlen); | 70 | out = malloc(outlen); |
71 | 71 | ||
72 | if (!out) | 72 | if (!out) |
73 | /* malloc failure */ | 73 | /* malloc failure */ |
diff --git a/src/lib/libssl/src/doc/crypto/EVP_PKEY_sign.pod b/src/lib/libssl/src/doc/crypto/EVP_PKEY_sign.pod index fb8e61cf29..1925706d96 100644 --- a/src/lib/libssl/src/doc/crypto/EVP_PKEY_sign.pod +++ b/src/lib/libssl/src/doc/crypto/EVP_PKEY_sign.pod | |||
@@ -69,7 +69,7 @@ Sign data using RSA with PKCS#1 padding and SHA256 digest: | |||
69 | if (EVP_PKEY_sign(ctx, NULL, &siglen, md, mdlen) <= 0) | 69 | if (EVP_PKEY_sign(ctx, NULL, &siglen, md, mdlen) <= 0) |
70 | /* Error */ | 70 | /* Error */ |
71 | 71 | ||
72 | sig = OPENSSL_malloc(siglen); | 72 | sig = malloc(siglen); |
73 | 73 | ||
74 | if (!sig) | 74 | if (!sig) |
75 | /* malloc failure */ | 75 | /* malloc failure */ |
diff --git a/src/lib/libssl/src/doc/crypto/EVP_PKEY_verify_recover.pod b/src/lib/libssl/src/doc/crypto/EVP_PKEY_verify_recover.pod index 4debf7bff0..095e53ea2f 100644 --- a/src/lib/libssl/src/doc/crypto/EVP_PKEY_verify_recover.pod +++ b/src/lib/libssl/src/doc/crypto/EVP_PKEY_verify_recover.pod | |||
@@ -79,7 +79,7 @@ Recover digest originally signed using PKCS#1 and SHA256 digest: | |||
79 | if (EVP_PKEY_verify_recover(ctx, NULL, &routlen, sig, siglen) <= 0) | 79 | if (EVP_PKEY_verify_recover(ctx, NULL, &routlen, sig, siglen) <= 0) |
80 | /* Error */ | 80 | /* Error */ |
81 | 81 | ||
82 | rout = OPENSSL_malloc(routlen); | 82 | rout = malloc(routlen); |
83 | 83 | ||
84 | if (!rout) | 84 | if (!rout) |
85 | /* malloc failure */ | 85 | /* malloc failure */ |
diff --git a/src/lib/libssl/src/doc/crypto/d2i_X509.pod b/src/lib/libssl/src/doc/crypto/d2i_X509.pod index e212014ac8..fad4e8c35b 100644 --- a/src/lib/libssl/src/doc/crypto/d2i_X509.pod +++ b/src/lib/libssl/src/doc/crypto/d2i_X509.pod | |||
@@ -91,7 +91,7 @@ Allocate and encode the DER encoding of an X509 structure: | |||
91 | 91 | ||
92 | len = i2d_X509(x, NULL); | 92 | len = i2d_X509(x, NULL); |
93 | 93 | ||
94 | buf = OPENSSL_malloc(len); | 94 | buf = malloc(len); |
95 | 95 | ||
96 | if (buf == NULL) | 96 | if (buf == NULL) |
97 | /* error */ | 97 | /* error */ |
@@ -159,7 +159,7 @@ mistake is to attempt to use a buffer directly as follows: | |||
159 | 159 | ||
160 | len = i2d_X509(x, NULL); | 160 | len = i2d_X509(x, NULL); |
161 | 161 | ||
162 | buf = OPENSSL_malloc(len); | 162 | buf = malloc(len); |
163 | 163 | ||
164 | if (buf == NULL) | 164 | if (buf == NULL) |
165 | /* error */ | 165 | /* error */ |
@@ -168,12 +168,12 @@ mistake is to attempt to use a buffer directly as follows: | |||
168 | 168 | ||
169 | /* Other stuff ... */ | 169 | /* Other stuff ... */ |
170 | 170 | ||
171 | OPENSSL_free(buf); | 171 | free(buf); |
172 | 172 | ||
173 | This code will result in B<buf> apparently containing garbage because | 173 | This code will result in B<buf> apparently containing garbage because |
174 | it was incremented after the call to point after the data just written. | 174 | it was incremented after the call to point after the data just written. |
175 | Also B<buf> will no longer contain the pointer allocated by B<OPENSSL_malloc()> | 175 | Also B<buf> will no longer contain the pointer allocated by B<malloc()> |
176 | and the subsequent call to B<OPENSSL_free()> may well crash. | 176 | and the subsequent call to B<free()> may well crash. |
177 | 177 | ||
178 | The auto allocation feature (setting buf to NULL) only works on OpenSSL | 178 | The auto allocation feature (setting buf to NULL) only works on OpenSSL |
179 | 0.9.7 and later. Attempts to use it on earlier versions will typically | 179 | 0.9.7 and later. Attempts to use it on earlier versions will typically |
diff --git a/src/lib/libssl/src/doc/crypto/ecdsa.pod b/src/lib/libssl/src/doc/crypto/ecdsa.pod index b981d865e4..9c8d633fc9 100644 --- a/src/lib/libssl/src/doc/crypto/ecdsa.pod +++ b/src/lib/libssl/src/doc/crypto/ecdsa.pod | |||
@@ -155,7 +155,7 @@ or using B<ECDSA_sign> | |||
155 | int buf_len; | 155 | int buf_len; |
156 | 156 | ||
157 | buf_len = ECDSA_size(eckey); | 157 | buf_len = ECDSA_size(eckey); |
158 | buffer = OPENSSL_malloc(buf_len); | 158 | buffer = malloc(buf_len); |
159 | pp = buffer; | 159 | pp = buffer; |
160 | if (!ECDSA_sign(0, dgst, dgstlen, pp, &buf_len, eckey) { | 160 | if (!ECDSA_sign(0, dgst, dgstlen, pp, &buf_len, eckey) { |
161 | /* error */ | 161 | /* error */ |