diff options
author | Daniel Fiala <daniel@openssl.org> | 2022-06-20 18:40:30 +0200 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2022-06-27 10:59:53 +0200 |
commit | a56ccd9ee283fec5ae0c0f4b848137c208e4e1a7 (patch) | |
tree | 01e0a0e13203a55cccc285a892f9b8db3c47909e /crypto/der_writer.c | |
parent | de2541c2806280845a6babfab4339ccb5bfca10f (diff) |
der_writer: Use uint32_t instead of long.
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18615)
(cherry picked from commit 59196250cb45ecd128d2f8bbc47de612167606d3)
Diffstat (limited to 'crypto/der_writer.c')
-rw-r--r-- | crypto/der_writer.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/crypto/der_writer.c b/crypto/der_writer.c index c6fd4c4298..bd330785f9 100644 --- a/crypto/der_writer.c +++ b/crypto/der_writer.c @@ -106,11 +106,11 @@ static int int_der_w_integer(WPACKET *pkt, int tag, && int_end_context(pkt, tag); } -static int int_put_bytes_ulong(WPACKET *pkt, const void *v, +static int int_put_bytes_uint32(WPACKET *pkt, const void *v, unsigned int *top_byte) { - const unsigned long *value = v; - unsigned long tmp = *value; + const uint32_t *value = v; + uint32_t tmp = *value; size_t n = 0; while (tmp != 0) { @@ -125,9 +125,9 @@ static int int_put_bytes_ulong(WPACKET *pkt, const void *v, } /* For integers, we only support unsigned values for now */ -int ossl_DER_w_ulong(WPACKET *pkt, int tag, unsigned long v) +int ossl_DER_w_uint32(WPACKET *pkt, int tag, uint32_t v) { - return int_der_w_integer(pkt, tag, int_put_bytes_ulong, &v); + return int_der_w_integer(pkt, tag, int_put_bytes_uint32, &v); } static int int_put_bytes_bn(WPACKET *pkt, const void *v, @@ -153,7 +153,7 @@ 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 ossl_DER_w_ulong(pkt, tag, 0); + return ossl_DER_w_uint32(pkt, tag, 0); return int_der_w_integer(pkt, tag, int_put_bytes_bn, v); } |