Comments (4)
hmmm, not sure, I need to reproduce it locally
from yar.
could you please try to find out (by editing the test) which part is wrong?
return ($provider == "Yar" && ($token == md5("yar") || $token == substr(md5("yar"), 0, 18)));
get the value of $provider and $token
from yar.
Tried on PHP 7.4, track $token using
if (!($provider == "Yar" && ($token == md5("yar") || $token == substr(md5("yar"), 0, 18)))) {
throw new Exception("prv=$provider\nmd5=" . md5("yar") . "(" . strlen(md5("yar")) . ")\ntok=$token(".strlen($token).")\n");
}
And I notice a additional char is present in retrieved value
array(5) {
["message"]=>
string(92) "prv=Yar
md5=883452d07c625e5dbbcdaaa47f0aa92d(32)
tok=883452d07c625e5dbbcdaaa47f0aa92d�(33)
"
["code"]=>
int(0)
["file"]=>
string(67) "/builddir/build/BUILD/php-pecl-yar-2.3.0/NTS/tests/htdocs/index.php"
["line"]=>
int(6)
["_type"]=>
string(9) "Exception"
}
from yar.
in yar_protocol.h
unsigned char provider[32];
unsigned char token[32];
So this is enough to store the 32 chars but not the NUL ending byte
so as the string is not nul terminated, strlen cannot be used
In yar_protocol.c
if (token) {
memcpy(header->token, token, MIN(strlen(token), 32));
}
from yar.
Related Issues (20)
- 自定义异常包含析构函数无法正常在client捕捉 HOT 1
- $callinfo的属性具体有哪些? HOT 1
- 客户端调用服务端,500错误,请看日志 HOT 3
- 服务端地址页面底部 多出来的信息是哪里来的? HOT 2
- yar 502 HOT 2
- rpc server请求连接池 和 权重动态调整 如何实现? HOT 2
- header中的provider和token可否自定义 HOT 1
- php8兼容性问题 HOT 1
- Wrong link to source code in PECL website HOT 1
- yar.go中调用yar报错need specifical request method HOT 3
- http2.0协议支持
- mac book pro M1 is not working properly HOT 2
- need specifical request method HOT 2
- yar 400 HOT 1
- Yar Server页面无法正常展示 HOT 3
- 服务端如何捕获异常?有没有统一的办法?
- Yar 远程调用用的什么协议?如果我用curl形式请求,格式应该是怎样的? HOT 3
- 使用php8.2 和 8.3时,编译报错 HOT 2
- Windows DLL available to download
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yar.