summaryrefslogtreecommitdiff
path: root/crypto/der_writer.c
diff options
context:
space:
mode:
authorDaniel Fiala <daniel@openssl.org>2022-06-20 18:40:30 +0200
committerTomas Mraz <tomas@openssl.org>2022-06-27 10:58:40 +0200
commit59196250cb45ecd128d2f8bbc47de612167606d3 (patch)
tree87629f973c88b5f3da5fe0651549bad9d30c45af /crypto/der_writer.c
parent48320997b49b07b5abadec89c7fbe5d5f3d41da4 (diff)
downloadopenssl-new-59196250cb45ecd128d2f8bbc47de612167606d3.tar.gz
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)
Diffstat (limited to 'crypto/der_writer.c')
-rw-r--r--crypto/der_writer.c12
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);
}