Hello, Ports! Mysql function ENCRYPT does not work after OpenBSD-5.7 (always return NULL):
# uname -a OpenBSD obsd59-64.vm.kmv 5.9 GENERIC.MP#1888 amd64 # mysql -p Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 3 Server version: 10.0.23-MariaDB-log OpenBSD port: mariadb-server-10.0.23p0v1 Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> help encrypt; Name: 'ENCRYPT' Description: Syntax: ENCRYPT(str[,salt]) Encrypts str using the Unix crypt() system call and returns a binary string. The salt argument must be a string with at least two characters or the result will be NULL. If no salt argument is given, a random value is used. URL: https://mariadb.com/kb/en/encrypt/ Examples: MariaDB> SELECT ENCRYPT('hello'); -> 'VxuFAJXVARROc' MariaDB [(none)]> select encrypt('1234','55'); +----------------------+ | encrypt('1234','55') | +----------------------+ | NULL | +----------------------+ 1 row in set (0.01 sec) MariaDB [(none)]> select encrypt('hello'); +------------------+ | encrypt('hello') | +------------------+ | NULL | +------------------+ 1 row in set (0.00 sec) MariaDB [(none)]> Seems it happens after this change: http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/lib/libc/crypt/crypt.c.diff?r1=1.26&r2=1.27 I think that, not only users, but mariadb developers not aware that the function remains, but does not work as expected. If crypt() function entirely excluded from the system, the problem would be detected on time and solved by linking with a third party library, as is done in other systems. Out of respect to readers, please refrain from explanations about the weakness of this encryption method, and so I shouldn't use it. It comes to updating the OS and migration of existing databases. I want to note: this function - ENCRYPT works as it explained in mariadb (mysql) help message on most operating systems such as linux, netbsd, freebsd, macosx, but not in OpenBSD. Regards, Michael Korbakov.