rust

MCU的调试接口——怎么堵住这个后门?

我怕爱的太早我们不能终老 提交于 2020-12-12 10:48:11
安全调试的前世今生 对于MCU的开发工程师来说,MCU的调试接口是必不可少的开发利器。透过调试接口,我们可以监视MCU的运行状态,查看或修改寄存器的数值,观察内存中的数据变化,通过IDE、调试器等开发工具配合,方便地排查各种棘手的问题。 我们需要了解的一切信息,调试接口都知无不言,言无不尽。 那么问题来了,在产品出厂后,黑客、攻击者就可以利用强大的调试接口对设备进行各种攻击,窃取产品中的敏感信息;黑色产业链也可以通过调试接口,轻而易举地读取出设备的固件,从而生产制造廉价的“破解版”。 正是由于调试接口功能强大,这个开发过程中的利器,也给产品带来了安全的漏洞和知识产权泄露的隐患。 针对这个问题,很多高附加值或安全敏感的产品,会选择在生产过程的最后一步,通过修改OTP Fuse等方式,将调试接口永久地禁掉。产品出厂后,调试接口已被封死,简单粗暴地解决调试接口带来的风险。 但是,产品的售后、维护往往不是一帆风顺的。产品在客户现场,也许会出现各种各样奇奇怪怪的问题。此时,由于调试接口被封掉,留给我们的调试排查手段捉襟见肘,产品出现问题后,难以定位更难以解决。 有没有一种方法,只能让开发者合法地调试芯片,而不会被攻击者利用呢? Secure Debug安全调试 传统的手段,是将调试接口永远的封死,那么Secure Debug就像是给调试接口加了一把坚固的锁

CNCF宣布TiKV毕业

爷,独闯天下 提交于 2020-12-12 07:15:26
云原生键值数据库项目在全球拥有近1000家生产用户 旧金山,加利福尼亚州-2020年9月2日- CNCF®(Cloud Native Computing Foundation®,云原生计算基金会)为云原生软件构建可持续的生态系统,今天宣布TiKV是第12个毕业的项目。从孵化阶段到毕业阶段,TiKV被越来越多的人采用,拥有一个开放的治理过程,特性成熟,以及对社区、可持续性和包容性的坚定承诺。 TiKV是一个以Rust编写的开源分布式事务键值数据库。它提供具有ACID保证的事务性键值API。项目为需要数据持久性、水平可伸缩性、分布式事务、高可用性和强一致性的应用程序提供了统一的分布式存储层,使其成为下一代云原生基础设施的理想数据库。 “TiKV是我们第一个基于Rust的项目,它是一个真正灵活和可扩展的云原生键值存储。”CNCF CTO/COO Chris Aniszczyk说:“自项目加入CNCF以来,我们对项目的成长及培育全球开源社区的愿望印象深刻。” 自2018年8月加入CNCF以来,在生产中采用TiKV的公司增加了一倍,达到了1000家,横跨多个行业,核心仓库的贡献者从78位增加到226位。维护团队目前有7人,所代表的企业分布健康,包括PingCAP、知乎、京东云、一点资讯等。 PingCAP 首席工程师、TiKV 项目负责人唐刘表示:“开源已经成为全球基础软件发展的重要方向

Get Body of Response in Actix web test request in Rust

青春壹個敷衍的年華 提交于 2020-12-12 05:38:36
问题 I'm building a web api service with rust and actix. I want to test a route and check if the received response body is what i expect. But I'm strugeling with converting the received body (ResponseBody) into a Json/Bson. The called route actually returns application/json. Thanks for your help. let mut app = test::init_service(App::new() .data(AppState { database: db.clone() }) .route("/recipes/{id}", web::post().to(add_one_recipe))).await; let payload = create_one_recipe().as_document().unwrap(

Why do return expressions use semicolons when they're unnecessary?

喜欢而已 提交于 2020-12-12 02:09:47
问题 I'm learning Rust and I've found something confusing with functions. According to the official reference, a return expression: .. [is] denoted with the keyword return. Evaluating a return expression moves its argument into the output slot of the current function, destroys the current function activation frame, and transfers control to the caller frame. So, this program works: fn main() { let current_hour = 10; let message = get_message(current_hour); println!("Good {0}", message); } fn get

Hacker News 简讯 2020-12-12

家住魔仙堡 提交于 2020-12-12 01:36:59
最后更新时间: 2020-12-12 01:00 CS 6120: Advanced Compilers: The Self-Guided Online Course - (cornell.edu) 高级编译器:在线自学课程 得分:111 | 评论:12 Who Americans spend their time with, by age - (ourworldindata.org) 美国人与谁共度时光,按年龄划分 得分:180 | 评论:124 GnuCOBOL 3.1.1 - (sourceforge.net) 格努科博3.1.1 得分:92 | 评论:111 Pointer Pointer (2012) - (pointerpointer.com) 指针指针(2012) 得分:344 | 评论:50 The 'Japanese Bob Ross': How a 73-year-old artist took YouTube by storm - (cnn.com) “日本人鲍勃·罗斯”:一位73岁的艺术家如何风靡YouTube 得分:117 | 评论:24 Smash Training Retrospective - (waleedkhan.name) 扣球训练回顾 得分:7 | 评论:1 Implementing Rust's Dbg in Python - (rtpg

Mutable iterator for Vec<Vec<(K, V)>>

|▌冷眼眸甩不掉的悲伤 提交于 2020-12-10 09:09:11
问题 I am trying to create an mutable iterator for a vector of type: Vec<Vec<(K, V)>> The iterator code: pub struct IterMut<'a, K: 'a, V: 'a> { iter: &'a mut Vec<Vec<(K, V)>>, ix: usize, inner_ix: usize, } impl<'a, K, V> Iterator for IterMut<'a, K, V> { type Item = (&'a K, &'a mut V); #[inline] fn next(&mut self) -> Option<(&'a K, &'a mut V)> { while self.iter.len() < self.ix { while self.iter[self.ix].len() < self.inner_ix { self.inner_ix += 1; let (ref k, ref mut v) = self.iter[self.ix][self

Mutable iterator for Vec<Vec<(K, V)>>

假如想象 提交于 2020-12-10 09:08:22
问题 I am trying to create an mutable iterator for a vector of type: Vec<Vec<(K, V)>> The iterator code: pub struct IterMut<'a, K: 'a, V: 'a> { iter: &'a mut Vec<Vec<(K, V)>>, ix: usize, inner_ix: usize, } impl<'a, K, V> Iterator for IterMut<'a, K, V> { type Item = (&'a K, &'a mut V); #[inline] fn next(&mut self) -> Option<(&'a K, &'a mut V)> { while self.iter.len() < self.ix { while self.iter[self.ix].len() < self.inner_ix { self.inner_ix += 1; let (ref k, ref mut v) = self.iter[self.ix][self

Rust linker seeks a LIB, rather than a DLL

穿精又带淫゛_ 提交于 2020-12-10 07:59:07
问题 I'm experimenting with Rust on Windows. My code declares and calls a function in an external library. The declaration is like this: #[link(name = "Rvea0326nc-64")] extern "C" { fn WeibullSpeedProbability(wa: &f32, wk: &f32, qu: &f32, prob: &f32, theerr: &i32) -> (); } (It's all ByRef because the DLL is Fortran. It's built with the Intel compiler.) Note that the file name has no extension. The DLL is in the \target\debug\deps folder of the Rust project. According to the documentation here

TIOBE 12 月编程语言:Python 有望第四次成为年度语言!

送分小仙女□ 提交于 2020-12-10 05:46:41
须臾间,2020 年已经不足一个月。近日,编程语言社区 TIOBE 最新发布了 12 月编程语言排行榜。下个月月初,TIOBE 社区也即将揭晓 2020 年年度编程语言,谁又能摘得桂冠? 毋庸置疑,能够获得年度编程语言称号的编程语言必然是 2020 年中最受关注以及流行度、涨幅最高的编程语言。对此,TIOBE 官方进行了相应的统计,在过去一年中,涨幅最大的为 Python,增幅 1.9%;其次为 C++ 0.71 %;R 语言增幅 0.6%、Groovy 增幅 0.69%。 综合来看,其他任何语言超过 Python 的机率都比较低。这意味着 Python 很有可能将于今年也是有史以来第四次获得年度编程语言称号的编程语言。 除了以上,值得关注的是,近几个月期间,TIOBE 榜单已然成为了 Python 与 Java 的追逐战战场。本月中,Java 虽然整体热度与趋势有所下滑,但还是再次超越了 Python 重回第二宝座。 其他编程语言排名 另外,本月编程语言榜单还有一些变化: Rust 从第 25 位上升到了 21 位; Julia 从 30 名上升到了第 26 名; Dart 从第 27 位下降到第 31 名; Kotlin 从第 36 位下降到第 40 位; TypeScript 从第 43 名上升一位,至第 42 名。 下面列出了完整的21-50名,因为是非官方发布的

What are the pros and cons of impl TryFrom<Bar> for Foo vs impl From<Bar> for Result<Foo, ()> for fallible conversions?

强颜欢笑 提交于 2020-12-09 14:00:43
问题 Starting from Rust 1.34, we can write fallible conversions between types by implementing the TryFrom trait: struct Foo(i32); struct Bar; impl TryFrom<Bar> for Foo { type Error = (); fn try_from(_b: Bar) -> Result<Foo, ()> { Ok(Foo(42)) } } In Rust 1.41, the orphan rule has been relaxed so we can also write: struct Foo(i32); struct Bar; impl From<Bar> for Result<Foo, ()> { fn from(_b: Bar) -> Result<Foo, ()> { Ok(Foo(42)) } } According to this trial both solutions seem to work equally well.