In the US, that's straight up illegal unless they write you a reference separately. When the hiring company calls they can only give the legal answers.
Also, you could just write that letter yourself and have a friend be your ex boss. The rules are meaningless and the points are made up.