diff options
author | Pauli <paul.dale@oracle.com> | 2020-09-30 12:15:12 +1000 |
---|---|---|
committer | Pauli <paul.dale@oracle.com> | 2020-10-01 11:25:12 +1000 |
commit | a55b00bdbc00b1632e551cf71bce72137e683c12 (patch) | |
tree | 250ce0774c55af4be08453594f249d30bb8fa91f /crypto/der_writer.c | |
parent | c4232b9edbeb242583a804dfb0bafaf57610e6fb (diff) |
der: _ossl prefix DER functions
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/13038)
Diffstat (limited to 'crypto/der_writer.c')
-rw-r--r-- | crypto/der_writer.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/crypto/der_writer.c b/crypto/der_writer.c index 8210327f06..c6fd4c4298 100644 --- a/crypto/der_writer.c +++ b/crypto/der_writer.c @@ -48,15 +48,16 @@ static int int_end_context(WPACKET *pkt, int tag) && (size1 == size2 || WPACKET_put_bytes_u8(pkt, tag)); } -int DER_w_precompiled(WPACKET *pkt, int tag, - const unsigned char *precompiled, size_t precompiled_n) +int ossl_DER_w_precompiled(WPACKET *pkt, int tag, + const unsigned char *precompiled, + size_t precompiled_n) { return int_start_context(pkt, tag) && WPACKET_memcpy(pkt, precompiled, precompiled_n) && int_end_context(pkt, tag); } -int DER_w_boolean(WPACKET *pkt, int tag, int b) +int ossl_DER_w_boolean(WPACKET *pkt, int tag, int b) { return int_start_context(pkt, tag) && WPACKET_start_sub_packet(pkt) @@ -66,8 +67,8 @@ int DER_w_boolean(WPACKET *pkt, int tag, int b) && int_end_context(pkt, tag); } -int DER_w_octet_string(WPACKET *pkt, int tag, - const unsigned char *data, size_t data_n) +int ossl_DER_w_octet_string(WPACKET *pkt, int tag, + const unsigned char *data, size_t data_n) { return int_start_context(pkt, tag) && WPACKET_start_sub_packet(pkt) @@ -77,7 +78,7 @@ int DER_w_octet_string(WPACKET *pkt, int tag, && int_end_context(pkt, tag); } -int DER_w_octet_string_uint32(WPACKET *pkt, int tag, uint32_t value) +int ossl_DER_w_octet_string_uint32(WPACKET *pkt, int tag, uint32_t value) { unsigned char tmp[4] = { 0, 0, 0, 0 }; unsigned char *pbuf = tmp + (sizeof(tmp) - 1); @@ -86,7 +87,7 @@ int DER_w_octet_string_uint32(WPACKET *pkt, int tag, uint32_t value) *pbuf-- = (value & 0xFF); value >>= 8; } - return DER_w_octet_string(pkt, tag, tmp, sizeof(tmp)); + return ossl_DER_w_octet_string(pkt, tag, tmp, sizeof(tmp)); } static int int_der_w_integer(WPACKET *pkt, int tag, @@ -124,7 +125,7 @@ static int int_put_bytes_ulong(WPACKET *pkt, const void *v, } /* For integers, we only support unsigned values for now */ -int DER_w_ulong(WPACKET *pkt, int tag, unsigned long v) +int ossl_DER_w_ulong(WPACKET *pkt, int tag, unsigned long v) { return int_der_w_integer(pkt, tag, int_put_bytes_ulong, &v); } @@ -147,17 +148,17 @@ static int int_put_bytes_bn(WPACKET *pkt, const void *v, return 1; } -int DER_w_bn(WPACKET *pkt, int tag, const BIGNUM *v) +int ossl_DER_w_bn(WPACKET *pkt, int tag, const BIGNUM *v) { if (v == NULL || BN_is_negative(v)) return 0; if (BN_is_zero(v)) - return DER_w_ulong(pkt, tag, 0); + return ossl_DER_w_ulong(pkt, tag, 0); return int_der_w_integer(pkt, tag, int_put_bytes_bn, v); } -int DER_w_null(WPACKET *pkt, int tag) +int ossl_DER_w_null(WPACKET *pkt, int tag) { return int_start_context(pkt, tag) && WPACKET_start_sub_packet(pkt) @@ -167,13 +168,13 @@ int DER_w_null(WPACKET *pkt, int tag) } /* Constructed things need a start and an end */ -int DER_w_begin_sequence(WPACKET *pkt, int tag) +int ossl_DER_w_begin_sequence(WPACKET *pkt, int tag) { return int_start_context(pkt, tag) && WPACKET_start_sub_packet(pkt); } -int DER_w_end_sequence(WPACKET *pkt, int tag) +int ossl_DER_w_end_sequence(WPACKET *pkt, int tag) { /* * If someone set the flag WPACKET_FLAGS_ABANDON_ON_ZERO_LENGTH on this |