diff options
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/asn1_dsa.c | 16 | ||||
-rw-r--r-- | crypto/der_writer.c | 27 | ||||
-rw-r--r-- | crypto/dsa/dsa_sign.c | 2 | ||||
-rw-r--r-- | crypto/ec/ec_asn1.c | 2 |
4 files changed, 24 insertions, 23 deletions
diff --git a/crypto/asn1_dsa.c b/crypto/asn1_dsa.c index 34835a5214..6578b8f606 100644 --- a/crypto/asn1_dsa.c +++ b/crypto/asn1_dsa.c @@ -152,7 +152,7 @@ int encode_der_dsa_sig(WPACKET *pkt, const BIGNUM *r, const BIGNUM *s) * * Returns 1 on success or 0 on failure. */ -int decode_der_length(PACKET *pkt, PACKET *subpkt) +int ossl_decode_der_length(PACKET *pkt, PACKET *subpkt) { unsigned int byte; @@ -184,7 +184,7 @@ int decode_der_length(PACKET *pkt, PACKET *subpkt) * trailing garbage then it is up to the caller to verify that all bytes * were consumed. */ -int decode_der_integer(PACKET *pkt, BIGNUM *n) +int ossl_decode_der_integer(PACKET *pkt, BIGNUM *n) { PACKET contpkt, tmppkt; unsigned int tag, tmp; @@ -192,7 +192,7 @@ int decode_der_integer(PACKET *pkt, BIGNUM *n) /* Check we have an integer and get the content bytes */ if (!PACKET_get_1(pkt, &tag) || tag != ID_INTEGER - || !decode_der_length(pkt, &contpkt)) + || !ossl_decode_der_length(pkt, &contpkt)) return 0; /* Peek ahead at the first bytes to check for proper encoding */ @@ -230,8 +230,8 @@ int decode_der_integer(PACKET *pkt, BIGNUM *n) * trailing garbage then it is up to the caller to verify that all bytes * were consumed. */ -size_t decode_der_dsa_sig(BIGNUM *r, BIGNUM *s, const unsigned char **ppin, - size_t len) +size_t ossl_decode_der_dsa_sig(BIGNUM *r, BIGNUM *s, + const unsigned char **ppin, size_t len) { size_t consumed; PACKET pkt, contpkt; @@ -240,9 +240,9 @@ size_t decode_der_dsa_sig(BIGNUM *r, BIGNUM *s, const unsigned char **ppin, if (!PACKET_buf_init(&pkt, *ppin, len) || !PACKET_get_1(&pkt, &tag) || tag != ID_SEQUENCE - || !decode_der_length(&pkt, &contpkt) - || !decode_der_integer(&contpkt, r) - || !decode_der_integer(&contpkt, s) + || !ossl_decode_der_length(&pkt, &contpkt) + || !ossl_decode_der_integer(&contpkt, r) + || !ossl_decode_der_integer(&contpkt, s) || PACKET_remaining(&contpkt) != 0) return 0; 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 diff --git a/crypto/dsa/dsa_sign.c b/crypto/dsa/dsa_sign.c index 71a60bb39b..6a887d8190 100644 --- a/crypto/dsa/dsa_sign.c +++ b/crypto/dsa/dsa_sign.c @@ -65,7 +65,7 @@ DSA_SIG *d2i_DSA_SIG(DSA_SIG **psig, const unsigned char **ppin, long len) sig->r = BN_new(); if (sig->s == NULL) sig->s = BN_new(); - if (decode_der_dsa_sig(sig->r, sig->s, ppin, (size_t)len) == 0) { + if (ossl_decode_der_dsa_sig(sig->r, sig->s, ppin, (size_t)len) == 0) { if (psig == NULL || *psig == NULL) DSA_SIG_free(sig); return NULL; diff --git a/crypto/ec/ec_asn1.c b/crypto/ec/ec_asn1.c index b50e2edbc8..e95cffd42c 100644 --- a/crypto/ec/ec_asn1.c +++ b/crypto/ec/ec_asn1.c @@ -1218,7 +1218,7 @@ ECDSA_SIG *d2i_ECDSA_SIG(ECDSA_SIG **psig, const unsigned char **ppin, long len) sig->r = BN_new(); if (sig->s == NULL) sig->s = BN_new(); - if (decode_der_dsa_sig(sig->r, sig->s, ppin, (size_t)len) == 0) { + if (ossl_decode_der_dsa_sig(sig->r, sig->s, ppin, (size_t)len) == 0) { if (psig == NULL || *psig == NULL) ECDSA_SIG_free(sig); return NULL; |