It is completely legal, unfortunately:1) A company is free to make its own decisions as to whom is hirable, or rehirable (so long as it does not discriminate on the basis of race, sex, religion, age over 40, disability, etc.), so it is legal to decide that you would not be rehired.2) Unless you had some sort of confidentiality agreement with your former employer (if you did, it may be enforced), they are free to tell anyone they choose whether they would or would not rehire you.3)  The only thing they can't do is to make untrue statements of fact about you (e.g. claim you stole from them, when you did not), since doing so might be defamation.