| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
There was a problem hiding this comment.
A less ifdef-y approach would be BIO_printf(bio, "0x%llx", static_cast<uint64_t>(exponent_word));
Sorry, something went wrong.
There was a problem hiding this comment.
I get
foo.c:16:65: warning: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 3 has type ‘long unsigned int’ [-Wformat=]
BIO_printf(bio, "0x%llx", static_cast<uint64_t>(exponent_word));
When I try 64bit mode
Sorry, something went wrong.
There was a problem hiding this comment.
Sorry, something went wrong.
There was a problem hiding this comment.
BIO_printf(bio, "0x%llx", static_cast<long long unsigned>(exponent_word));
works though
Sorry, something went wrong.
There was a problem hiding this comment.
Oh damn but then I get
src/node_crypto.cc:1540: Use int16/int64/etc, rather than the C type long [runtime/int] [4]
Sorry, something went wrong.
|
I think this gets us the best of both worlds @bnoordhuis ? |
Sorry, something went wrong.
|
I'm fairly sure Visual Studio doesn't have inttypes.h but we'll find out soon enough: https://ci.nodejs.org/job/node-test-pull-request/5099/ |
Sorry, something went wrong.
|
Looks like you were right? Shall we go back to ifdefs ? |
Sorry, something went wrong.
|
Windows passed? |
Sorry, something went wrong.
|
Looks like nothing passed. Maybe I should try the #ifdef approach again? |
Sorry, something went wrong.
|
@posix4e Lots of other stuff failed, but it looks like windows did indeed pass. https://ci.nodejs.org/job/node-test-commit-windows-fanned/5557/ |
Sorry, something went wrong.
|
Forgive my noobness but what are the next steps? Shall I return the ifdefs or is this sufficient? Does anyone agree about the merit of the patch?It seems windows might have passed (again excuse my noob) what is causing the other build failures? |
Sorry, something went wrong.
|
Ok going back to my original ifdef patch unless anyone has some suggestions? |
Sorry, something went wrong.
There was a problem hiding this comment.
Can this be an #else?
Sorry, something went wrong.
There was a problem hiding this comment.
No, not exactly, there's a third case that I was hoping would break. I can handle it, it only happens on VMS and alpha
Sorry, something went wrong.
There was a problem hiding this comment.
Thinking about it more, what about this?
uint64_t exponent_word = static_cast<uint64_t>(BN_get_word(rsa->e));
uint32_t lo = static_cast<uint32_t>(exponent_word);
uint32_t hi = static_cast<uint32_t>(exponent_word >> 32);
if (hi == 0) {
BIO_printf(bio, "0x%x", lo);
} else {
BIO_printf(bio, "0x%x%08x", hi, lo);
}
Sorry, something went wrong.
There was a problem hiding this comment.
FIne by me. Seems less clear, but if you'd prefer
Sorry, something went wrong.
|
ring a ling a ding dong. Anything else we should do? |
Sorry, something went wrong.
|
one more run of ci: https://ci.nodejs.org/job/node-test-pull-request/5410/ oh hi @posix4e o/ also can you modify the commit to include the subsystem and under 50 characters, might I suggest |
Sorry, something went wrong.
|
Does this mean great build success? |
Sorry, something went wrong.
|
generally we don't put a colon at the end of the commit title. Otherwise the commit looks in order. I'll have to defer to @bnoordhuis for the actual review. @addaleax may be able to help out as well. |
Sorry, something went wrong.
warning: format ‘%lx’ expects argument of type ‘long
unsigned int’, but argument 3 has type ‘unsigned int’ [-Wformat=]
BIO_printf(bio, "0x%lx", exponent_word);
|
updated commit comment |
Sorry, something went wrong.
|
I'll land this end of day if there are no objections |
Sorry, something went wrong.
warning: format ‘%lx’ expects argument of type ‘long
unsigned int’, but argument 3 has type ‘unsigned int’ [-Wformat=]
BIO_printf(bio, "0x%lx", exponent_word);
PR-URL: #10082
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
warning: format ‘%lx’ expects argument of type ‘long
unsigned int’, but argument 3 has type ‘unsigned int’ [-Wformat=]
BIO_printf(bio, "0x%lx", exponent_word);
PR-URL: #10082
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Notable changes:
* **crypto**:
- Allow adding extra certificates to well-known CAs. (Sam Roberts)
[#9139](#9139)
* **buffer**:
- Fix single-character string filling. (Anna Henningsen)
[#9837](#9837)
- Handle UCS2 `.fill()` properly on BE. (Anna Henningsen)
[#9837](#9837)
* **url**:
- Add inspect function to TupleOrigin. (Safia Abdalla)
[#10039](#10039)
- Including base argument in originFor. (joyeecheung)
[#10021](#10021)
- Improve URLSearchParams spec compliance. (Timothy Gu)
[#9484](#9484)
* **http**:
- Remove stale timeout listeners. (Karl Böhlmark)
[#9440](#9440)
* **build**:
- Fix node_g target. (Daniel Bevenius)
[#10153](#10153)
* **fs**:
- Remove unused argument from copyObject(). (EthanArrowood)
[#10041](#10041)
* **timers**:
- Fix handling of cleared immediates. (hveldstra)
[#9759](#9759)
* **src**:
- Add wrapper for process.emitWarning(). (SamRoberts)
[#9139](#9139)
- Fix string format mistake for 32 bit node.(Alex Newman)
[#10082](#10082)
warning: format ‘%lx’ expects argument of type ‘long
unsigned int’, but argument 3 has type ‘unsigned int’ [-Wformat=]
BIO_printf(bio, "0x%lx", exponent_word);
PR-URL: nodejs/node#10082
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
warning: format ‘%lx’ expects argument of type ‘long
unsigned int’, but argument 3 has type ‘unsigned int’ [-Wformat=]
BIO_printf(bio, "0x%lx", exponent_word);
PR-URL: #10082
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
warning: format ‘%lx’ expects argument of type ‘long
unsigned int’, but argument 3 has type ‘unsigned int’ [-Wformat=]
BIO_printf(bio, "0x%lx", exponent_word);
PR-URL: #10082
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
warning: format ‘%lx’ expects argument of type ‘long
unsigned int’, but argument 3 has type ‘unsigned int’ [-Wformat=]
BIO_printf(bio, "0x%lx", exponent_word);
PR-URL: #10082
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
warning: format ‘%lx’ expects argument of type ‘long
unsigned int’, but argument 3 has type ‘unsigned int’ [-Wformat=]
BIO_printf(bio, "0x%lx", exponent_word);
PR-URL: #10082
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
warning: format ‘%lx’ expects argument of type ‘long
unsigned int’, but argument 3 has type ‘unsigned int’ [-Wformat=]
BIO_printf(bio, "0x%lx", exponent_word);
PR-URL: #10082
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
warning: format ‘%lx’ expects argument of type ‘long
unsigned int’, but argument 3 has type ‘unsigned int’ [-Wformat=]
BIO_printf(bio, "0x%lx", exponent_word);
PR-URL: #10082
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
warning: format ‘%lx’ expects argument of type ‘long
unsigned int’, but argument 3 has type ‘unsigned int’ [-Wformat=]
BIO_printf(bio, "0x%lx", exponent_word);
PR-URL: #10082
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
| Back | FazBrowse Home | New Git URL |
Checklist
Affected core subsystem(s)
crypto
Description of change
I noticed a warning reminscint of a format-string vuln. I think i have made the format string correct on non alpha based systems.
The warning was
unsigned int’, but argument 3 has type ‘unsigned int’ [-Wformat=] BIO_printf(bio, "0x%lx", exponent_word);